A factorial, written n!, is the product of all positive integers from 1 up to n: 5! = 1 × 2 × 3 × 4 × 5 = 120. By definition 0! = 1, and each step follows the rule n! = n × (n−1)!. Factorials grow astonishingly fast, so this calculator uses exact big-integer arithmetic to keep every digit correct, and also reports the digit count, scientific notation, and trailing zeros.
Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: the factorial definition and Legendre's formula for trailing zeros, recomputed in code.
Definition and key facts
Each factorial builds on the last, which is why they explode in size: multiplying by an ever-larger n every step. The trailing zeros come from factors of 10 = 2 × 5 in the product; since there are always more 2s than 5s, you just count the 5s with Legendre's formula. Factorials are defined only for whole numbers ≥ 0 — the gamma function generalises them to other values.
Worked example — 5!, 10! and 20!
Scenario: three factorials showing how fast they grow.
5! is 120; multiplying on up to 10 gives 3,628,800; by 20! the answer is already a 19-digit number, 2,432,902,008,176,640,000. That value is past the safe range of ordinary floating-point numbers, which is exactly why exact big-integer math matters. 10! ends in 2 zeros (⌊10/5⌋ = 2) and 20! ends in 4 (⌊20/5⌋ = 4), as the calculator confirms.
Frequently Asked Questions
n! is 1 × 2 × … × n. So 5! = 120 and 4! = 24. Each is the previous times n: 5! = 5 × 4!. It counts orderings of n items.
It's the empty product (= 1) and keeps n! = n × (n−1)! valid at n = 1. It also makes nPr and nCr formulas work.
Fast: 10! = 3,628,800, 13! = 6,227,020,800, 20! = 2,432,902,008,176,640,000. Exact big-integer math keeps all digits right.
⌊n/5⌋ + ⌊n/25⌋ + … 10! has 2 zeros; 25! has 5 + 1 = 6. Zeros come from 2×5 pairs, and 5s are scarcer.
Permutations, combinations, probability, series like eˣ, and the binomial theorem. Defined only for integers ≥ 0.