Factorial Calculator
Compute n! for any n from 0 to 170 with exact integer precision. See the step-by-step calculation and digit count for large results.
Range: 0 to 170. Beyond 170, the result overflows double-precision floating point.
0! = 1 (by definition)2! = 2 × 1 = 23! = 3 × 2 = 64! = 4 × 6 = 245! = 5 × 24 = 1206! = 6 × 120 = 7207! = 7 × 720 = 50408! = 8 × 5040 = 403209! = 9 × 40320 = 36288010! = 10 × 362880 = 3628800| n | n! | Digits |
|---|---|---|
| 0! | 1 | 1 |
| 1! | 1 | 1 |
| 2! | 2 | 1 |
| 3! | 6 | 1 |
| 4! | 24 | 2 |
| 5! | 120 | 3 |
| 6! | 720 | 3 |
| 7! | 5040 | 4 |
| 8! | 40320 | 5 |
| 9! | 362880 | 6 |
| 10! | 3628800 | 7 |
| 12! | 479001600 | 9 |
| 15! | 1307674368000 | 13 |
| 20! | 243290…640000 (19 digits) | 19 |
| 25! | 155112…000000 (26 digits) | 26 |
| 50! | 304140…000000 (65 digits) | 65 |
| 100! | 933262…000000 (158 digits) | 158 |
How Many Ways Can 8 People Sit at a Dinner Table?
Eight people, eight chairs, one table. The first person can sit in any of 8 seats. The second person can sit in any of 7 remaining seats. The third in 6, and so on. Total arrangements: 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320. That is 8!, read as "eight factorial." The same logic applies to shuffling a deck of cards (52! ≈ 8 × 10⁶⁷ arrangements — more than the number of atoms in the observable universe), arranging exam question orders, or counting the number of possible routes a delivery driver can take through 10 stops. Factorials are what happens when arrangement and order matter simultaneously.
This free factorial calculator handles exact integer results from 0! to 170! using JavaScript BigInt — no rounding, no approximation. For n ≤ 12, the full step-by-step multiplication chain is shown so you can follow along. The reference table lists key factorial values alongside their digit counts.
The Growth Rate Is Harder to Grasp Than It Looks
Exponential growth gets talked about constantly — but factorial growth is in a different category entirely. An exponential function like 2ⁿ doubles every step. Factorials grow faster than any exponential. Compare: 2¹⁰ = 1,024. But 10! = 3,628,800. By n = 20, the gap is catastrophic — 2²⁰ ≈ 1 million, while 20! ≈ 2.4 × 10¹⁸. At n = 52 (a deck of cards), 52! has 68 digits. At n = 100, the result has 158 digits. At n = 170 (the calculator's maximum), 170! has 307 digits.
For large n where the exact value is not needed, Stirling's approximation — n! ≈ √(2πn) × (n/e)ⁿ — gives a remarkably accurate estimate. The relative error drops below 1% by n = 10 and continues shrinking. It appears in statistical mechanics, quantum physics, and thermodynamics wherever counting arrangements of large particle systems is required. Use the Scientific Calculator to evaluate the Stirling formula for any n.
Factorials in Taylor Series — Why They Appear in Every Expansion
One place factorials appear that surprises students is in Taylor series. The expansion eˣ = 1 + x + x²/2! + x³/3! + x⁴/4! + … has factorials in every denominator. The same is true for sin(x) = x − x³/3! + x⁵/5! − … and cos(x) = 1 − x²/2! + x⁴/4! − … The factorials are not arbitrary — they come from repeated differentiation. The nth derivative of eˣ is eˣ, evaluated at 0 is 1. Dividing by n! normalises the coefficient so the series converges properly. Without the factorial denominators, the series would grow unboundedly.
In combinatorics, C(n, r) = n! / (r! × (n−r)!) counts selections where order does not matter — choosing 3 students from 30 for a project team, for instance. For those calculations directly, the Permutation & Combination Calculator computes nCr and nPr without needing to evaluate the full factorials separately. Everything on this page runs entirely in your browser — no data leaves your device.
✓Verified by ToollyX Team · Last updated June 2026