A factorial is a countdown you multiply
Some operations grow by adding; a factorial grows by multiplying by a bigger number every step, which is why it outruns almost everything else in elementary maths. The factorial of n, written n!, is the product of every whole number from n down to 1 — and that simple rule is the counting engine underneath permutations, combinations, lottery odds and probability itself: the number of ways to arrange n distinct items in a row is exactly n!, because there are n choices for the first place, n−1 for the second, and so on down to 1. The combination calculator spends factorials to count selections; this page isolates the factorial itself, computes it with exact integer arithmetic, and reports the two facts people ask about next — how many digits the answer has, and how many zeros it ends with.
The formula, with every term defined
n! = n × (n − 1) × (n − 2) × … × 3 × 2 × 1The same rule, one step at a time: n! = n × (n − 1)! — with 0! = 1 and 1! = 1 as the starting valuesTrailing zeros of n! = ⌊n ÷ 5⌋ + ⌊n ÷ 25⌋ + ⌊n ÷ 125⌋ + … (counting the factors of 5, since factors of 2 are always more plentiful)
n is any whole number from 0 upwards — factorials are not defined for negative numbers or fractions on this page (the gamma function, mentioned in the questions below, extends the idea to those). The recursive form is the same multiplication seen from the side: each factorial is the previous one times the new top number, so 6! is just 6 × 5! — the property the result table checks on every calculation. The trailing zeros rule deserves its one line of explanation: a trailing zero is a factor of 10, which is 2 × 5; in any factorial run there are always more 2s than 5s among the factors, so the 5s are the bottleneck, and counting them — one for every multiple of 5, an extra one for every multiple of 25, and so on — counts the zeros without ever computing the number.
Worked example: 10!
The default above enters n = 10. Written out in full, the multiplication is 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1, and it is worth watching it build: 10 × 9 = 90, × 8 = 720, × 7 = 5,040, × 6 = 30,240, × 5 = 151,200, × 4 = 604,800, × 3 = 1,814,400, × 2 = 3,628,800, × 1 = 3,628,800. So 10! = 3,628,800 — a 7-digit number, ending in 2 trailing zeros (the factors of 5 come from 5 and from 10, which contributes one more). The recursive check closes exactly: 9! is 362,880, and 10 × 362,880 = 3,628,800. In scientific notation the value is 3.6288 × 106. Ten items — the players in a photograph, the runners in a race — can be arranged in over three and a half million orders, which is the concrete fact the abstract multiplication is really stating.
How fast factorials grow
| n | n! exactly | Digits | Trailing zeros |
|---|---|---|---|
| 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 0 |
| 3 | 6 | 1 | 0 |
| 5 | 120 | 3 | 1 |
| 8 | 40,320 | 5 | 1 |
| 10 — worked example | 3,628,800 | 7 | 2 |
| 12 | 479,001,600 | 9 | 2 |
| 15 | 1,307,674,368,000 | 13 | 3 |
| 20 | 2,432,902,008,176,640,000 | 19 | 4 |
Read the jumps, not just the values: from 8! to 10! the answer grows ninety-fold in two steps, because each step multiplies by the whole of the next integer rather than adding a fixed layer — factorials outgrow even the exponential growth of the exponent calculator, whose multiplier at least stays constant. By 20! the count is 2,432,902,008,176,640,000 — 19 digits, already beyond the exact reach of an ordinary calculator display — with 4 trailing zeros (one each from 5, 10 and 15, and one from 20). Further out the same rules still answer instantly: 25! ends in 6 zeros (25 contributes two factors of 5, not one), and 100! has 158 digits and 24 trailing zeros. This page computes exactly up to 1,000!, which has 2,568 digits — every one of them printed, none of them rounded.
Reading a factorial honestly — size, precision and limits
Three cautions belong with any figure from this page. Exact is not the same as usable. A 2,568-digit integer is a perfectly precise answer and a perfectly useless one for most purposes — beyond small n, what usually matters is the size of the number (its digit count, its trailing zeros, its first few digits in scientific notation), which is why the table reports all three alongside the full value. Floating-point calculators quietly stop being exact at 21!. Ordinary number arithmetic carries about 15–17 significant digits, so past 20! a standard display is showing a rounded neighbour of the true integer, not the integer — this page uses whole-number arithmetic without that ceiling, which is the only honest way to print a factorial. And factorials stop where counting stops: there is no factorial of −3 or of 2.5 in the counting sense, however often the symbols appear. The gamma function extends the curve through fractions — (½)! = √π ÷ 2 ≈ 0.8862 — and through every positive real number, but that is a different, calculus-built object; the questions below mark the boundary plainly rather than pretending the countdown multiplication covers it. Within its stated ground — whole numbers, counted exactly — every result on this page can be rebuilt by hand from the previous one, one multiplication at a time.
Frequently asked questions
Why is 0! equal to 1?
For two reasons that agree. The counting reason: 0! counts the ways to arrange zero items, and there is exactly one way to do that — arrange nothing. The consistency reason: the rule n! = n × (n−1)! has to hold at n = 1, so 1! = 1 × 0! forces 0! = 1. Defining 0! as 1 is what makes the formulas built on factorials — combinations such as C(n, 0) = 1, series expansions, probability — work without special cases bolted on. This calculator returns 0! = 1 and says so in the result, rather than treating zero as an error.
How many trailing zeros does a factorial have?
Count the factors of 5. Every trailing zero is a factor of 10 = 2 × 5, and any run of multiplied whole numbers contains far more 2s than 5s, so the 5s decide: zeros = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …, where the brackets mean round down. For 10!: ⌊10/5⌋ = 2, and indeed 3,628,800 ends in two zeros. For 25! the second term switches on — ⌊25/5⌋ + ⌊25/25⌋ = 5 + 1 = 6 zeros — because 25 = 5 × 5 smuggles in a second factor of 5. The calculator counts the zeros this way and prints the count beside the exact value, so the two can be checked against each other.
What are factorials used for?
Counting arrangements and selections, above all. The permutations of n items are n!; the combinations counted by the combination calculator are C(n, r) = n! ÷ (r! × (n−r)!) — the 2,598,960 possible five-card poker hands are 52! divided by 5! and 47!. The same structure appears in probability (the denominator of most 'how many outcomes' questions), in the series that define e and the trigonometric functions, and anywhere a process makes a shrinking sequence of choices — tournament orders, seating plans, shuffle counts. If a problem's choices multiply as the options run out, a factorial is usually standing underneath it.
How big does a factorial get?
Faster than intuition allows. 10! is 3,628,800 — already in the millions. 20! is 2,432,902,008,176,640,000, a 19-digit number. 100! has 158 digits, and 1,000! — this calculator's limit — has 2,568 digits. The growth beats exponential growth because the multiplier itself keeps rising: an exponential multiplies by the same number every step, while a factorial multiplies by 10, then 11, then 12. One practical consequence: the number of possible shuffles of a 52-card deck, 52!, is about 8 × 10^67 — so large that a properly shuffled deck is, for practical purposes, in an order no deck has ever been in before.
Can you take the factorial of a fraction or a negative number?
Not with the counting definition on this page — the countdown multiplication needs a whole number to count down from, and factorials of negative whole numbers are undefined (the recursive step would demand division by zero). The idea is extended to fractions and other real numbers by the gamma function, written Γ, which agrees with the factorial at every whole number (Γ(n+1) = n!) and fills the gaps smoothly: (½)! = Γ(3/2) = √π ÷ 2 ≈ 0.8862 is its most famous value. That extension belongs to calculus rather than counting, so this calculator states the boundary — whole numbers from 0 to 1,000 — instead of quietly returning gamma values under a factorial label.
