What Is a Factorial (n!)?
In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. By mathematical definition and convention in combinatorics, 0! equals 1.
How to Use the Factorial Calculator
- Enter any non-negative integer n (for example, 5, 8, or 12).
- Click "Calculate Factorial".
- View the total product, intermediate sequence (e.g. 5 × 4 × 3 × 2 × 1), and scientific notation for large results.
Formula & How the Calculation Works
0! = 1
Factorials grow exceptionally quickly (combinatorial explosion). For instance, 10! is already 3,628,800.
Worked Calculation Example
Scenario: Calculate 5! (5 factorial).
- Write out descending product: 5 × 4 × 3 × 2 × 1.
- Multiply sequentially: 5 × 4 = 20; 20 × 3 = 60; 60 × 2 = 120; 120 × 1 = 120.
- Result: 5! = 120.
Key Considerations & Common Mistakes to Avoid
- Confusing 0! with 0: 0! is mathematically defined as 1 (the empty product).
- Entering negative numbers: Factorials are standardly defined only for non-negative integers.
- Expecting standard integer precision above 20!: Values above 21! exceed JavaScript 64-bit safe integer limits and require scientific notation.