Factorial Table (0! to 30!)

The factorial n! is the product of all whole numbers from 1 to n. The table gives every factorial from 0! to 30! exactly, computed with arbitrary-precision integers rather than rounded floating-point numbers.

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.

Exact values of n!
nn!Digits
011
111
221
361
4242
51203
67203
75,0404
840,3205
9362,8806
103,628,8007
1139,916,8008
12479,001,6009
136,227,020,80010
1487,178,291,20011
151,307,674,368,00013
1620,922,789,888,00014
17355,687,428,096,00015
186,402,373,705,728,00016
19121,645,100,408,832,00018
202,432,902,008,176,640,00019
2151,090,942,171,709,440,00020
221,124,000,727,777,607,680,00022
2325,852,016,738,884,976,640,00023
24620,448,401,733,239,439,360,00024
2515,511,210,043,330,985,984,000,00026
26403,291,461,126,605,635,584,000,00027
2710,888,869,450,418,352,160,768,000,00029
28304,888,344,611,713,860,501,504,000,00030
298,841,761,993,739,701,954,543,616,000,00031
30265,252,859,812,191,058,636,308,480,000,00033

Sources: OEIS Foundation: A000142 Factorial numbers n!

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

References

Frequently asked questions

What is 0 factorial?

0! = 1. It is defined that way so that the recursion n! = n × (n − 1)! works for n = 1 and so that combination formulas give the right counts.

Can you take the factorial of a negative number?

No. n! is defined only for non-negative integers, and the gamma function has poles at 0, −1, −2, …, so negative integers have no factorial.