Factorial Calculator — Compute n! Step by Step (Free)
Fractions & numbersFreeNo sign-up
A factorial calculator multiplies every whole number from 1 up to n: n! = n × (n − 1) × … × 2 × 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120, and 10! = 3,628,800. Enter any n below for the exact value with every digit, the digit count, trailing zeros and the steps.
Show steps
- Definition: n! = n × (n − 1) × … × 2 × 1, and 0! = 1 (there is exactly one way to arrange nothing).
- 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800.
- Build it up with n! = n × (n − 1)!: 5! = 120, 6! = 720, 7! = 5,040, 8! = 40,320, 9! = 362,880, 10! = 3,628,800.
- Digits: the number of digits is ⌊log₁₀(n!)⌋ + 1 = ⌊6.559763⌋ + 1 = 7.
- Trailing zeros (Legendre’s formula): each zero needs a 10 = 2 × 5, and 5s are rarer than 2s, so count the factors of 5: ⌊10/5⌋ = 2. Total = 2.
- Stirling’s formula: n! ≈ √(2πn) × (n/e)ⁿ = 3,598,700. It is about 0.83% too low (roughly 1/(12n)), and the relative error shrinks as n grows.
Prime factorization of 10!
Stirling vs exact
| n | n! | Stirling | Error |
|---|---|---|---|
| 1 | 1 | 0.922137 | 7.79% |
| 2 | 2 | 1.919 | 4.05% |
| 5 | 120 | 118.019 | 1.65% |
| 10 | 3,628,800 | 3,598,700 | 0.83% |
| 20 | 2.432902 × 10¹⁸ | 2.42279 × 10¹⁸ | 0.416% |
| 50 | 3.0414093 × 10⁶⁴ | 3.03634 × 10⁶⁴ | 0.167% |
| 100 | 9.3326215 × 10¹⁵⁷ | 9.32485 × 10¹⁵⁷ | 0.0833% |
How to use the factorial calculator
- Choose a mode: n! for an ordinary factorial, n!! for a double factorial, n! / k! to cancel two factorials, or x! decimals for non-integers such as 0.5!.
- Type the number. Whole-number factorials are exact up to n = 50,000 (213,237 digits); up to one billion you still get the digit count, trailing zeros and the leading digits.
- Read the answer, then open Show steps, the full list of digits, the prime factorization of n! and the Stirling comparison table.
What is a factorial?
The factorial of a whole number n, written n!, is the product of all whole numbers from 1 to n. It counts the ways to arrange n different objects in a row: 3 books can be ordered in 3! = 6 ways. Factorials grow very fast, because each one is the previous one times the next number:
n! = n × (n − 1)!, with 0! = 1.
So 6! = 720 gives 7! = 7 × 720 = 5,040 and 8! = 8 × 5,040 = 40,320. Setting 0! = 1 keeps this rule working (1! = 1 × 0!) and matches the fact that there is exactly one way to arrange nothing.
Factorial table from 0! to 15!
| n | n! | n | n! |
|---|---|---|---|
| 0 | 1 | 8 | 40,320 |
| 1 | 1 | 9 | 362,880 |
| 2 | 2 | 10 | 3,628,800 |
| 3 | 6 | 11 | 39,916,800 |
| 4 | 24 | 12 | 479,001,600 |
| 5 | 120 | 13 | 6,227,020,800 |
| 6 | 720 | 14 | 87,178,291,200 |
| 7 | 5,040 | 15 | 1,307,674,368,000 |
Trailing zeros of n! (Legendre’s formula)
Every trailing zero comes from a factor 10 = 2 × 5. A factorial has far more factors of 2 than of 5, so the number of trailing zeros equals the number of factors of 5:
zeros(n!) = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …
For 100!: ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24 zeros. For 1000!: 200 + 40 + 8 + 1 = 249 zeros. The same counting gives the exponent of any prime p in n!, which is how the calculator writes the prime factorization of n!.
How many digits does n! have?
The number of digits of a positive whole number N is ⌊log10 N⌋ + 1. Since log10(n!) = log10 1 + log10 2 + … + log10 n, the digit count follows without computing n! itself. For 100!, log10(100!) ≈ 157.97, so 100! has 158 digits.
Stirling’s approximation
For large n, n! ≈ √(2πn) · (n/e)n. The approximation is always a little low, by about 1/(12n) as a fraction: 0.83% at n = 10, 0.083% at n = 100 and 0.0083% at n = 1,000. The calculator shows Stirling’s value and its error next to the exact answer, so you can see the error shrink as n grows.
Double factorial, n! / k! and factorials of decimals
- Double factorial: n!! multiplies every second number, so 9!! = 9 × 7 × 5 × 3 × 1 = 945 and 10!! = 10 × 8 × 6 × 4 × 2 = 3,840. For even n = 2k, n!! = 2k · k!. It is not the same as (n!)!.
- Cancelling factorials: 10! / 8! = 10 × 9 × 8! / 8! = 90. Combinations use the same idea: C(6, 2) = 6! / (2! · 4!) = 720 / 48 = 15.
- Decimals: the gamma function extends factorials to non-integers with x! = Γ(x + 1). Then 0.5! = √π/2 ≈ 0.886227 and 2.5! = 15√π/8 ≈ 3.323351. Negative whole numbers such as (−3)! are undefined.
Common mistakes with factorials
| Mistake | Correct version |
|---|---|
| Thinking 0! = 0 | 0! = 1 by definition. |
| Computing 10! / 8! as (10/8)! | Factorials do not divide that way: 10! / 8! = 10 × 9 = 90. |
| Reading 2n! as (2n)! | 2n! means 2 × n!. With n = 3, 2n! = 2 × 3! = 12, while (2n)! = 6! = 720. |
| Treating n!! as (n!)! | n!! skips every second factor: 6!! = 48, while (6!)! = 720! is enormous. |
| Trusting a calculator’s 70! overflow | Many calculators stop at 69! or 170!; use exact arithmetic or logarithms beyond that. |
To check homework, cancel common factors by hand first and estimate the size with the digit count. Then compare each step with the calculator’s working.
Factorial practice quiz: 10 questions
Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.
6! = 6 × 5 × 4 × 3 × 2 × 1 = 720. 21 is 6 + 5 + 4 + 3 + 2 + 1, a sum rather than a product.
0! = 1 by definition. It keeps the rule n! = n × (n − 1)! working for n = 1.
Count factors of 5: ⌊50/5⌋ + ⌊50/25⌋ = 10 + 2 = 12. Forgetting the extra 5s in 25 and 50 gives 10.
7!! = 7 × 5 × 3 × 1 = 105. A double factorial skips every second number.
Cancel 4!: (7 × 6 × 5) / (3 × 2 × 1) = 210 / 6 = 35. 210 forgets to divide by 3!.
Quiz complete
Frequently asked questions
What is factorial 100?
100! is about 9.3326 × 10157. It has 158 digits and ends in 24 zeros. Enter 100 above to see all 158 digits.
What is 1000 factorial?
1000! is about 4.0239 × 102567. It has 2,568 digits, and 249 of them are trailing zeros.
How do you calculate factorial quickly?
Use n! = n × (n − 1)! and build from a value you know. If you remember 6! = 720, then 7! = 5,040 and 8! = 40,320. Memorizing 1, 2, 6, 24, 120 and 720 covers most textbook problems.
What is 5 factorial?
5! = 5 × 4 × 3 × 2 × 1 = 120. It is the number of ways to arrange 5 different objects in a row.
Where is the factorial button on a calculator?
It is usually labelled x! or n!. On many Casio models it is a second function of the x−1 key; on TI graphing calculators it is in the MATH menu under PROB. Most handheld calculators overflow after 69!, which is why exact tools are useful for larger n.
How do you calculate factorial without a calculator?
Multiply step by step, and in fractions cancel before multiplying. For example, 10! ÷ 8! = 10 × 9 = 90, and 7! / (3! · 4!) = (7 × 6 × 5) / (3 × 2 × 1) = 35.
Related calculators
- Permutations and combinations calculator: nPr and nCr built from factorials
- Prime factorization calculator: factor any whole number
- Binomial probability calculator: probabilities that use C(n, k)
- Scientific notation converter: read huge results like 10157
More fractions & numbers calculators
Related to This Article
More math articles
- Top 10 3rd Grade PSSA Math Practice Questions
- Free Grade 4 English Worksheets for Ohio Students
- Concrete Calculator
- The Best Grade 6 ELA Practice Tests for Mississippi Students
- Enlightenment thinkers, especially John Locke
- How to Solve an Absolute Value Inequality?
- What Kind of Math Is on the TABE Test?
- Reading Scientific Data Tables
- Wisconsin Forward Grade 7 Math Worksheets: 95 Free Printable PDFs Covering Every Skill
- How to Find the Volume of Spheres? (+FREE Worksheet!)



What people say about "Factorial Calculator: Exact n!, Digits, Zeros & Steps"?
No one replied yet.