FactLab
Factorial Calculator
n! = n × (n−1) × … × 1.
Factorials from 0 to 20
n factorial is the product of every whole number from 1 to n. It counts the number of ways n distinct items can be arranged in order.
| n | n! | Meaning |
|---|---|---|
| 0 | 1 | One way to arrange nothing |
| 1 | 1 | One arrangement |
| 3 | 6 | Orderings of 3 books |
| 5 | 120 | Orderings of 5 people |
| 6 | 720 | Orderings of 6 items |
| 8 | 40,320 | Orderings of 8 |
| 10 | 3,628,800 | Orderings of 10 |
| 12 | 479,001,600 | Orderings of 12 |
| 15 | 1,307,674,368,000 | Orderings of 15 |
| 20 | 2,432,902,008,176,640,000 | Orderings of 20 |
0! is defined as 1, which looks arbitrary but is required for the combination and permutation formulas to work at the edges - and there is exactly one way to arrange an empty set. Growth is astonishing: 20! is over two quintillion, larger than the number of seconds since the Big Bang. That is why shuffling a deck of 52 cards produces an order almost certainly never seen before - 52! is roughly 8 followed by 67 zeros. Beyond 21!, results exceed what a double-precision number can represent exactly, so very large factorials lose precision.
Counting every possible order
n! counts the number of ways to arrange n distinct items in a row — 5 books on a shelf can be ordered 5! = 120 different ways, since there are 5 choices for the first spot, 4 for the next, and so on.
Why it grows so fast
Factorials explode in size — 10! is already over 3.6 million, and 20! exceeds a quintillion — which is why it's central to combinatorics, probability, and permutation/combination formulas.
Frequently asked questions
What is a factorial?
n! = n × (n−1) × (n−2) × … × 1. It counts the number of ways to arrange n distinct items. 5! = 5×4×3×2×1 = 120. By convention, 0! = 1 (there's exactly one way to arrange zero items: do nothing).
Why is 0! equal to 1?
There's exactly one way to arrange zero objects: the empty arrangement. It also makes the permutation and combination formulas work: C(n,0) = n!/(0!×n!) = 1, which correctly says there's one way to choose nothing.
What is the largest factorial a calculator can handle?
Most standard calculators overflow at 170! (≈7.26 × 10³⁰⁶) because 171! exceeds the largest floating-point number. This calculator goes up to 170!. For larger values, use Stirling's approximation: n! ≈ √(2πn) × (n/e)ⁿ.
Related Math calculators
Fibonacci Calculator
Nth Fibonacci number and its ratio to the previous term.
OpenPrime Number Check
Check whether a number is prime and see its prime factorisation.
OpenFactors Calculator
All divisors of a positive integer.
OpenPrime Factorization Calculator
Break a number down into its prime factors, written in exponent form.
OpenLast updated: September 6, 2026