A small factorial: 5!
- Input
- n = 5
- Working
- 5! = 5 × 4 × 3 × 2 × 1 = 20 × 3 × 2 × 1 = 60 × 2 × 1 = 120.
- Result
- 5! = 120
Compute exact factorials up to 1000! as full big numbers, see the digit count, and compare Stirling's approximation beside the exact value. Runs entirely in your browser — your numbers never leave this device.
| n | n! (exact) |
|---|---|
| 0 | 1 |
| 1 | 1 |
| 2 | 2 |
| 3 | 6 |
| 4 | 24 |
| 5 | 120 |
| 6 | 720 |
| 7 | 5,040 |
| 8 | 40,320 |
| 9 | 362,880 |
| 10 | 3,628,800 |
| 15 | 1,307,674,368,000 |
| 20 | 2,432,902,008,176,640,000 |
The factorial of a whole number n, written n!, is the product of every whole number from n down to 1 — so 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorials grow faster than almost anything else in school mathematics: 10! is already 3,628,800 and 20! is over 2.4 quintillion. Ordinary calculators overflow or switch to rounded scientific notation almost immediately, so this calculator uses exact big-number arithmetic and prints every digit of the result for any n up to 1000, together with a digit count — 1000! has 2,568 digits, far beyond what a pocket calculator can show.
For large n the calculator also shows Stirling's approximation, n! ≈ √(2πn) × (n / e)ⁿ, beside the exact value so you can judge how good the shortcut is. It is remarkably close even for modest n: for 100! Stirling's formula gives about 9.32485 × 10¹⁵⁷ against the exact 9.33262 × 10¹⁵⁷ — roughly 0.08% too small. The approximation matters because it is how mathematicians estimate factorials that are far too large to write out at all.
Two inputs are refused with an explanation rather than a made-up answer. Factorials are only defined here for whole numbers from 0 to 1000: a negative number has no factorial, and fractional inputs like 2.5! belong to the gamma function, a university-level extension that this tool deliberately stays out of. The special case 0! = 1 is not a fudge — it is the value that keeps the rule n! = n × (n−1)! consistent, since 1! = 1 × 0! forces 0! = 1.
Two reasons agree on it. Combinatorially, 0! counts the ways to arrange zero objects, and there is exactly one way to arrange nothing. Algebraically, the rule n! = n × (n−1)! applied at n = 1 gives 1! = 1 × 0!, so 0! must be 1 for the rule to hold. It is a definition, but a forced one — any other value would break the formulas built on factorials.
2,568 digits. Factorial digit counts grow roughly in step with n itself, which is why exact results quickly become impractical to print: 10! has 7 digits, 100! has 158, and 1000! has 2,568. The calculator shows the digit count alongside the value for exactly this reason.
Very, and it improves as n grows. For 10! it gives about 3,598,696 against the exact 3,628,800 (about 0.83% low); for 100! it is only about 0.08% low. The relative error shrinks roughly in proportion to 1/n, so for the huge factorials where the exact value cannot be written down, Stirling's formula is accurate to many significant figures.
Counting arrangements and selections. n! is the number of ways to order n distinct items — 5 people in a line can be arranged in 5! = 120 orders — and factorials sit inside the permutation and combination formulas and the probability calculations built on them, as well as series expansions in calculus.
Not with this tool, and not with the ordinary definition. The product n × (n−1) × … × 1 never terminates for a negative or fractional starting value. Mathematicians extend the idea with the gamma function, which agrees with the factorial at whole numbers and gives values in between, but that is a separate, more advanced function and is kept out of this calculator on purpose.
No. The big-number multiplication runs 100% in your browser on your own device — even a 2,568-digit result is produced locally, nothing is uploaded or stored, and no record of your calculation remains once you close the page.
More in Math Calculators · Browse all tools