What is factorial?
The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 through n. By definition, 0! = 1. Factorials count permutations: n distinct objects can be lined up in n! orders.
Why 0! = 1?
Treating 0! as 1 makes the rule n! = n × (n−1)! work for n = 1, and matches the "empty product" convention in combinatorics (one way to arrange zero objects).
How factorial works
Compute n! by multiplying 1 × 2 × … × n. Growth is extremely fast: 10! is millions, 20! is huge, 100! has 158 digits. This calculator uses BigInt for exact integers up to 170!.
Factorial examples
- 5! = 120
- 10! = 3,628,800
- 0! = 1
- Double: 7!! = 7 × 5 × 3 × 1 = 105