Factorial Calculator
The factorial of n, written n!, is the product of every whole number from 1 up to n. It counts the ways to arrange n different items and underlies permutations, combinations and probability. Because factorials grow extremely fast, this calculator uses exact big-number arithmetic and also reports the number of digits, the trailing zeros and the double factorial.
How to use the factorial calculator
- Enter a whole number from 0 to 1,000.
- Read n! (shown in full for smaller values and in scientific notation for very large ones).
- Use the digit count and trailing-zero rows for quick estimates and puzzle questions.
Formula
n! = n × (n − 1) × (n − 2) × … × 2 × 1, with 0! = 1. Trailing zeros = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … because each zero comes from a factor pair 2 × 5, and factors of 5 are scarcer than factors of 2. The double factorial n!! multiplies every second number: n × (n − 2) × (n − 4) × …
Worked examples
10 factorial
10! = 3,628,800. It has 7 digits and 2 trailing zeros, since ⌊10/5⌋ = 2.
100 factorial
100! has 158 digits and 24 trailing zeros (20 + 4 from multiples of 5 and 25).
Understanding factorials
Why factorials count arrangements
With 3 books you have 3 choices for the first spot, 2 for the second and 1 for the last: 3 × 2 × 1 = 6 arrangements. With n items it is n!. That is why factorials sit at the heart of permutations and combinations.
How fast they grow
| n | n! |
|---|---|
| 5 | 120 |
| 10 | 3,628,800 |
| 15 | 1,307,674,368,000 |
| 20 | 2,432,902,008,176,640,000 |
A deck of 52 cards can be arranged in 52! ways, a number with 68 digits. Any well-shuffled deck is almost certainly in an order that has never occurred before.
Counting trailing zeros
Every trailing zero comes from a factor of 10 = 2 × 5. Twos are plentiful, so count the fives: ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … For 100! that gives 20 + 4 = 24 zeros.
Beyond whole numbers
The gamma function extends factorials to non-integers, and it gives the famous fact that (½)! = √π ÷ 2. That is beyond this tool, but it shows the idea is deeper than repeated multiplication.
Practice problems
Try these yourself first, then check your answer. The answers come from the calculator above.
- What is 7!?
Show answer
7!: 5,040
- What is 20! and how many trailing zeros does it have?
Show answer
20!: 2,432,902,008,176,640,000
Common mistakes to avoid
- Thinking 0! = 0. By definition 0! = 1, which keeps combination formulas working.
- Trying to compute a factorial of a negative or fractional number. The ordinary factorial needs a non-negative integer.
- Confusing n! with the double factorial n!!.
Frequently asked questions
What is 0 factorial?
1. There is exactly one way to arrange zero items: do nothing.
Why do factorials grow so fast?
Each step multiplies by a larger number than the last, so growth outpaces even exponential growth for large n.
How are factorials used?
To count arrangements (permutations), selections (combinations) and probabilities. See the permutation and combination calculator.
How many trailing zeros does 25! have?
6, because ⌊25/5⌋ + ⌊25/25⌋ = 5 + 1.
Reviewed September 26, 2026 by the SolveCalcPro editorial team. Found a mistake? Tell us; see our editorial policy.