Factorial Calculator
10!
36,28,800
10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 36,28,800
Digits
7
Trailing zeros
2
Approximately
3.6288 × 10^6
What is a factorial?
The factorial of a whole number n, written n!, is the product of all whole numbers from 1 to n: 5! = 5 × 4 × 3 × 2 × 1 = 120. It counts the ways to arrange n different things in a row, and appears in permutations, combinations and probability. Factorials grow very fast, so this calculator gives the exact value with every digit, up to 5000!.
Factorial formulas
n! = n × (n − 1) × … × 2 × 1 · 0! = 1 · n! = n × (n − 1)! · Trailing zeros = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …
Each trailing zero comes from a factor 10 = 2 × 5. There are always more 2s than 5s, so counting the factors of 5 gives the number of zeros at the end.
Good to know
- 0! = 1 by definition: there is exactly one way to arrange nothing.
- A deck of 52 cards can be shuffled into 52! ≈ 8.07 × 10⁶⁷ orders, more than the number of atoms on Earth.
- nPr = n! ÷ (n − r)! and nCr = n! ÷ (r! (n − r)!) use factorials.
- Factorials are only defined for whole numbers; the gamma function extends them to other numbers.
- Stirling's formula, n! ≈ √(2πn) (n/e)ⁿ, estimates large factorials.
Worked example
- 5! = 5 × 4 × 3 × 2 × 1 = 120
- 10! = 36,28,800
- 20! = 2432902008176640000 (19 digits)
- 100! has 158 digits and ends in ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24 zeros
Factorials from 0 to 20
Exact values with their digit counts and trailing zeros.
| n | n! | Digits | Trailing zeros |
|---|---|---|---|
| 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 0 |
| 2 | 2 | 1 | 0 |
| 3 | 6 | 1 | 0 |
| 4 | 24 | 2 | 0 |
| 5 | 120 | 3 | 1 |
| 6 | 720 | 3 | 1 |
| 7 | 5,040 | 4 | 1 |
| 8 | 40,320 | 5 | 1 |
| 9 | 3,62,880 | 6 | 1 |
| 10 | 36,28,800 | 7 | 2 |
| 11 | 3,99,16,800 | 8 | 2 |
| 12 | 47,90,01,600 | 9 | 2 |
| 13 | 6,22,70,20,800 | 10 | 2 |
| 14 | 87,17,82,91,200 | 11 | 2 |
| 15 | 13,07,67,43,68,000 | 13 | 3 |
| 16 | 2,09,22,78,98,88,000 | 14 | 3 |
| 17 | 35,56,87,42,80,96,000 | 15 | 3 |
| 18 | 6,40,23,73,70,57,28,000 | 16 | 3 |
| 19 | 1,21,64,51,00,40,88,32,000 | 18 | 3 |
| 20 | 24,32,90,20,08,17,66,40,000 | 19 | 4 |
20! is the largest factorial below 10¹⁹.