This page provides a complete factorial table for whole numbers from 0 through 30. For each value of n, the table lists the exact factorial n!, the number of digits in that factorial, the base‑10 logarithm log₁₀(n!), and the count of trailing zeros (the number of consecutive zeros at the end of the decimal representation). The table also includes a worked example for 10! and a formula section that defines the factorial and explains how to compute trailing zeros.
Factorials appear throughout mathematics, especially in combinatorics, probability, and calculus. Students learning permutations and combinations, programmers dealing with algorithms that count arrangements, and anyone working with binomial coefficients or series expansions will find this table useful for quick reference and for verifying calculations.
Formula
n! = n × (n − 1) × … × 2 × 1 for whole numbers n ≥ 1, and 0! = 1. Recursively n! = n × (n − 1)!. Trailing zeros of n! = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … (Legendre’s formula for the prime 5).
Worked Example
Work out 10!, the calculator default.
| Step | Working | Result |
|---|---|---|
| 1 | 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 | 3,628,800 |
| 2 | digits | 7 |
| 3 | log10(10!) | 6.5598 |
| 4 | trailing zeros = ⌊10/5⌋ | 2 |
n! for n = 0 to 30 (exact)
| n | n! | Digits | log10(n!) | Trailing zeros |
|---|---|---|---|---|
| 0 | 1 | 1 | 0.000000 | 0 |
| 1 | 1 | 1 | 0.000000 | 0 |
| 2 | 2 | 1 | 0.301030 | 0 |
| 3 | 6 | 1 | 0.778151 | 0 |
| 4 | 24 | 2 | 1.380211 | 0 |
| 5 | 120 | 3 | 2.079181 | 1 |
| 6 | 720 | 3 | 2.857332 | 1 |
| 7 | 5,040 | 4 | 3.702431 | 1 |
| 8 | 40,320 | 5 | 4.605521 | 1 |
| 9 | 362,880 | 6 | 5.559763 | 1 |
| 10 | 3,628,800 | 7 | 6.559763 | 2 |
| 11 | 39,916,800 | 8 | 7.601156 | 2 |
| 12 | 479,001,600 | 9 | 8.680337 | 2 |
| 13 | 6,227,020,800 | 10 | 9.794280 | 2 |
| 14 | 87,178,291,200 | 11 | 10.940408 | 2 |
| 15 | 1,307,674,368,000 | 13 | 12.116500 | 3 |
| 16 | 20,922,789,888,000 | 14 | 13.320620 | 3 |
| 17 | 355,687,428,096,000 | 15 | 14.551069 | 3 |
| 18 | 6,402,373,705,728,000 | 16 | 15.806341 | 3 |
| 19 | 121,645,100,408,832,000 | 18 | 17.085095 | 3 |
| 20 | 2,432,902,008,176,640,000 | 19 | 18.386125 | 4 |
| 21 | 51,090,942,171,709,440,000 | 20 | 19.708344 | 4 |
| 22 | 1,124,000,727,777,607,680,000 | 22 | 21.050767 | 4 |
| 23 | 25,852,016,738,884,976,640,000 | 23 | 22.412494 | 4 |
| 24 | 620,448,401,733,239,439,360,000 | 24 | 23.792706 | 4 |
| 25 | 15,511,210,043,330,985,984,000,000 | 26 | 25.190646 | 6 |
| 26 | 403,291,461,126,605,635,584,000,000 | 27 | 26.605619 | 6 |
| 27 | 10,888,869,450,418,352,160,768,000,000 | 29 | 28.036983 | 6 |
| 28 | 304,888,344,611,713,860,501,504,000,000 | 30 | 29.484141 | 6 |
| 29 | 8,841,761,993,739,701,954,543,616,000,000 | 31 | 30.946539 | 6 |
| 30 | 265,252,859,812,191,058,636,308,480,000,000 | 33 | 32.423660 | 7 |
How to read this table
Each row of the table corresponds to a single value of n. For example, the row for n = 5 shows that 5! = 120, which has 3 digits, a base‑10 logarithm of about 2.079181, and 1 trailing zero. The row for n = 15 gives 15! = 1,307,674,368,000, a 13‑digit number with log₁₀ ≈ 12.116500 and 3 trailing zeros. As n increases, the factorial grows rapidly, so the digit count and logarithm both increase.
The Trailing zeros column counts the number of zeros at the end of the number, which is determined by the number of factors of 5 in n! (since there are always more factors of 2).
To use the table, locate the desired n and read across. For example, the row for n = 30 shows 30! = 265,252,859,812,191,058,636,308,480,000,000, which has 33 digits, log₁₀ ≈ 32.423660, and 7 trailing zeros. The table is exact for all values shown, so you can rely on these numbers for calculations or for checking your own work.
Patterns and Properties Visible in the Table
Several important properties of factorials become apparent when you scan the table. First, 0! = 1 and 1! = 1. The definition 0! = 1 is chosen so that formulas involving permutations and combinations work consistently, such as the number of ways to arrange zero objects (exactly one way: do nothing). The recursive relation n! = n × (n−1)! is also visible: for example, 5! = 5 × 4! = 5 × 24 = 120, and 6! = 6 × 5! = 6 × 120 = 720.
Another pattern is the rapid growth of the factorial. From n = 0 to n = 4, the values are small (1, 1, 2, 6, 24), but by n = 10 the value is already 3,628,800, and by n = 30 it is a 33‑digit number.
The trailing zeros column shows a stepwise pattern. This pattern reflects the fact that each multiple of 5 contributes one factor of 5, and each multiple of 25 contributes an extra factor. For example, 10! has 2 trailing zeros because 10/5 = 2, and 30! has 7 because 30/5 + 30/25 = 6 + 1 = 7.
How to Compute Factorials by Hand
To compute a factorial by hand, start with 1 and multiply by each integer from 1 up to n. For example, to compute 6!, you would do 1 × 2 = 2, 2 × 3 = 6, 6 × 4 = 24, 24 × 5 = 120, 120 × 6 = 720. This is the direct multiplication method, which works well for small n. For larger n, you can use the recursive relation n! = n × (n−1)! if you already know (n−1)!.
To find the number of digits without computing the full factorial, use the logarithm: the number of digits is ⌊log₁₀(n!)⌋ + 1. For example, log₁₀(10!) ≈ 6.5598, so the digit count is 6 + 1 = 7. The table provides log₁₀ values, so you can verify this. To compute log₁₀(n!) by hand, you would sum log₁₀(k) for k = 1 to n, but this is tedious; calculators or tables are more practical.
To count trailing zeros, use Legendre’s formula for the prime 5: add ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … until the quotient becomes zero. For example, for n = 10, ⌊10/5⌋ = 2, so 10! has 2 trailing zeros. For n = 30, ⌊30/5⌋ + ⌊30/25⌋ = 6 + 1 = 7. This works because each factor of 5 pairs with a factor of 2 to create a factor of 10, and there are always more factors of 2 than 5 in any factorial.
Practical Uses of Factorials
The most common use of factorials is in counting arrangements, or permutations. The number of ways to arrange n distinct objects in a row is n!. For example, the number of ways to arrange 5 books on a shelf is 5! = 120. Similarly, the number of ways to choose and arrange k objects from n is given by n!/(n−k)!, which uses factorials.
Factorials also appear in combinations, where the number of ways to choose k objects from n (without regard to order) is n!/(k!(n−k)!). These formulas are essential in probability, statistics, and many areas of computer science, such as analyzing algorithms that involve permutations or combinations.
In calculus, factorials appear in Taylor series expansions, such as the series for eˣ, which involves terms like xⁿ/n!. In physics and engineering, factorials appear in statistical mechanics and in the binomial distribution. The table provides exact values up to 30!, which is sufficient for many practical calculations; beyond that, approximations like Stirling’s formula are used.
Common Mistakes and Misconceptions
One common mistake is thinking that 0! should be 0, but by definition 0! = 1. This is not an arbitrary choice; it is necessary for formulas to work. For example, the number of ways to arrange 0 objects is 1 (the empty arrangement), and the combination formula n!/(0!(n−0)!) = n!/(1·n!) = 1, which is correct.
Another mistake is confusing the number of digits with the value of the factorial. For example, 10! = 3,628,800 has 7 digits, but the number itself is not 7; the digit count is just a measure of size. Similarly, log₁₀(n!) is not the factorial itself but its logarithm, which helps compare magnitudes.
A third mistake is miscounting trailing zeros. A common slip is to count only the multiples of 5: 25! has ⌊25/5⌋ + ⌊25/25⌋ = 5 + 1 = 6 trailing zeros, not 5. The extra zero comes from the factor 25, which contributes two factors of 5. Always use the formula to avoid errors.
Limits and Precision of the Table
This table provides exact values for n! from 0 to 30. Beyond 30, the numbers grow so large that they become unwieldy to write out fully.
For larger n, Stirling’s approximation is often used: n! is approximately equal to √(2πn) × (n/e)ⁿ. This gives a good estimate for large n, and the relative error decreases as n grows. The table’s log₁₀ column is useful because it allows you to estimate the size of factorials beyond 30 by extrapolating the logarithm, though the exact values would require more computation.
When using factorials in calculations, be aware of the limits of your calculator or software. For combinatorial problems, it is often better to use logarithms or to simplify expressions before computing, to avoid dealing with enormous numbers.
Frequently Asked Questions
Why is 0! equal to 1?
0! is defined as 1 so that formulas involving factorials work consistently. For example, the number of ways to arrange zero objects is exactly one way (the empty arrangement). Also, the recursive relation n! = n × (n−1)! requires that 1! = 1 × 0!, so 0! must be 1. Without this definition, many combinatorial formulas would break.
How do I find the number of trailing zeros in n!?
Use Legendre’s formula for the prime 5: add ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … until the quotient becomes zero. For example, for 10!, ⌊10/5⌋ = 2, so there are 2 trailing zeros. For 30!, ⌊30/5⌋ + ⌊30/25⌋ = 6 + 1 = 7. This counts the factors of 5, which pair with factors of 2 to create zeros.
What is the largest factorial in the table?
The largest factorial in the table is 30! = 265,252,859,812,191,058,636,308,480,000,000. It has 33 digits, a base‑10 logarithm of about 32.423660, and 7 trailing zeros. Beyond 30, the values become even larger and are not listed here.
How do I use the log10 column?
The log₁₀(n!) column gives the base‑10 logarithm of the factorial. The number of digits is ⌊log₁₀(n!)⌋ + 1. For example, log₁₀(10!) ≈ 6.5598, so 10! has 7 digits. The logarithm also helps compare the sizes of factorials without writing out the full numbers.
Why does the number of trailing zeros increase slowly?
Trailing zeros come from factors of 10, which require a factor of 2 and a factor of 5. Since there are always more factors of 2 than 5 in n!, the number of zeros is determined by the count of factors of 5. Multiples of 5 add one factor, multiples of 25 add an extra, and so on, so the count increases slowly—for example, 15! has 3 zeros, 20! has 4, and 25! has 6.
Calculators that go with this table
Method and sources
Exact integer arithmetic (no rounding) for n!; log10 rounded to 6 decimals. Above 170! the value exceeds double precision, which is why the calculator stops at 170.
Source formulas: the standard textbook definitions written out in the Formula section above. Every value in the tables was generated from those formulas in code and spot-checked against the worked example and the calculator on this page; nothing was copied from another table.
Related
Formula used
in n | Whole number n | - | 10 | 0 | 170 out f | n! | - | fact(n) | 0 out lg | log10(n!) | - | log10(fact(n)) | 4
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
- GCD and LCM Table for Numbers 1 to 2072
- Prime Factorization Chart 2 to 2000
- Decimal, Binary and Hex Conversion Table 0 to 2558 bits
- How to Take Clothing Size Measurements
- Pounds per Clothing Size: What to Expect
- Far From What Clothing? Meaning & Origins100 %