Definition
n! = n × (n − 1) × (n − 2) × … × 2 × 1 for a positive integer n, and 0! = 1. Equivalently, n! = n × (n − 1)!, which is the recursion used to build the table.
0! = 1 because the empty product is 1, and because it keeps formulas such as n! = n × (n − 1)! and the number of ways to arrange zero objects (one way: do nothing) consistent.
The gamma function extends the factorial to non-integers: Γ(n + 1) = n! for whole numbers n, and Γ(½) = √π, so (½)! = √π ÷ 2 ≈ 0.886227.
Sources: NIST Digital Library of Mathematical Functions: DLMF §5.4 Gamma Function: Special Values
Factorials 0! to 30!
Values from 21! onward exceed 2⁶³ and cannot be stored exactly in ordinary 64-bit integers, which is why many calculators switch to scientific notation there.
| n | n! | Digits |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| 2 | 2 | 1 |
| 3 | 6 | 1 |
| 4 | 24 | 2 |
| 5 | 120 | 3 |
| 6 | 720 | 3 |
| 7 | 5,040 | 4 |
| 8 | 40,320 | 5 |
| 9 | 362,880 | 6 |
| 10 | 3,628,800 | 7 |
| 11 | 39,916,800 | 8 |
| 12 | 479,001,600 | 9 |
| 13 | 6,227,020,800 | 10 |
| 14 | 87,178,291,200 | 11 |
| 15 | 1,307,674,368,000 | 13 |
| 16 | 20,922,789,888,000 | 14 |
| 17 | 355,687,428,096,000 | 15 |
| 18 | 6,402,373,705,728,000 | 16 |
| 19 | 121,645,100,408,832,000 | 18 |
| 20 | 2,432,902,008,176,640,000 | 19 |
| 21 | 51,090,942,171,709,440,000 | 20 |
| 22 | 1,124,000,727,777,607,680,000 | 22 |
| 23 | 25,852,016,738,884,976,640,000 | 23 |
| 24 | 620,448,401,733,239,439,360,000 | 24 |
| 25 | 15,511,210,043,330,985,984,000,000 | 26 |
| 26 | 403,291,461,126,605,635,584,000,000 | 27 |
| 27 | 10,888,869,450,418,352,160,768,000,000 | 29 |
| 28 | 304,888,344,611,713,860,501,504,000,000 | 30 |
| 29 | 8,841,761,993,739,701,954,543,616,000,000 | 31 |
| 30 | 265,252,859,812,191,058,636,308,480,000,000 | 33 |
Where factorials are used
- Arrangements: n distinct objects can be ordered in n! ways
- Permutations: nPr = n! ÷ (n − r)!
- Combinations: nCr = n! ÷ (r!(n − r)!)
- Taylor series: eˣ = Σ xⁿ ÷ n!
- Stirling's approximation: n! ≈ √(2πn)(n/e)ⁿ, accurate to under 1% for n ≥ 9