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

  1. 5! = 5 × 4 × 3 × 2 × 1 = 120
  2. 10! = 36,28,800
  3. 20! = 2432902008176640000 (19 digits)
  4. 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.

nn!DigitsTrailing zeros
0110
1110
2210
3610
42420
512031
672031
75,04041
840,32051
93,62,88061
1036,28,80072
113,99,16,80082
1247,90,01,60092
136,22,70,20,800102
1487,17,82,91,200112
1513,07,67,43,68,000133
162,09,22,78,98,88,000143
1735,56,87,42,80,96,000153
186,40,23,73,70,57,28,000163
191,21,64,51,00,40,88,32,000183
2024,32,90,20,08,17,66,40,000194

20! is the largest factorial below 10¹⁹.

Frequently Asked Questions

10! = 10 × 9 × … × 1 = 36,28,800.
There is exactly one way to arrange zero objects. It also keeps formulas consistent: n! = n × (n − 1)! gives 1! = 1 × 0!, so 0! = 1.
24. Count the factors of 5: ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4.
Not with the usual definition, which is only for whole numbers 0, 1, 2, …. The gamma function extends it, but it's beyond school maths.