Factorial Calculator

In short: n! means 1 × 2 × 3 × … × n — the number of ways to arrange n distinct objects. 5! = 120; 20! = 2,432,902,008,176,640,000 exactly. This calculator uses big-integer arithmetic, so its answers are exact to the last digit, and it reports the digit count and trailing zeros alongside.

Growth that outruns exponents

Factorials grow faster than any exponential with a fixed base, because the multiplier itself keeps growing: 2n doubles each step, but n! multiplies by 2, then 3, then 4, then 100. The numbers leave intuition behind almost immediately. 10! is already 3.6 million; 20! is 2.43 × 1018; 52! — the number of orders of a shuffled deck — is 8.07 × 1067, a figure exceeding the count of atoms in the Earth, so every thorough shuffle in history has almost certainly produced an arrangement never dealt before. 100! has 158 digits. By 1000! you are reading 2,568 digits, all of which this page computes exactly using arbitrary-precision integers rather than the floating-point arithmetic that silently rounds (and then overflows at 171!) on ordinary calculators.

Two questions this page answers alongside the value are worth understanding. Trailing zeros are not counted by printing the number and squinting — Legendre's formula counts them: each trailing zero is a 2 × 5 pair inside the product, 2s are abundant, so the zeros equal the number of 5s among the factors, ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … For 100! that is 20 + 4 = 24. Digit count is just the length of the exact result here; for astronomically large n, Stirling's approximation (n! ≈ √(2πn) (n/e)ⁿ) estimates it without computing the number itself — accurate to a fraction of a percent even at n = 100.

And the boundary cases: 0! = 1, forced both by the descending pattern (divide 1! by 1) and by combinatorics (there is exactly one arrangement of nothing). Negative integers have no factorial — the product has nowhere to start — and non-integers need the gamma function, the continuous extension in which (1/2)! = √π/2; both are noted here rather than silently erroring, because a factorial that returns nonsense for edge inputs teaches the wrong mathematics.

Permutations and combinations — factorials at work

Two formulas spend factorials for a living. A permutation counts ordered selections: choosing a president, secretary and treasurer from 20 members is 20! ÷ 17! = 20 × 19 × 18 = 6,840 outcomes — order matters, so most of the factorial cancels and a short product remains. A combination ignores order: a committee of 3 from the same 20 is 20! ÷ (3! × 17!) = 1,140 — exactly the permutation count divided by the 3! = 6 orders each committee could have been picked in. The famous application is the lottery: choosing 6 numbers from 49 gives 49! ÷ (6! × 43!) = 13,983,816 combinations, which is why a single ticket's jackpot chance is about one in fourteen million. Notice the practical pattern: factorials in real formulas almost always appear as ratios in which the enormous parts cancel — nobody computes 49! in full to price a lottery ticket, though this page happily will.

Worked examples

5! = 120. Five books on a shelf: 5 choices for the first slot, 4 for the second, then 3, 2, 1 — 5 × 4 × 3 × 2 × 1 = 120 arrangements. This counting is the factorial's native habitat.

20! = 2,432,902,008,176,640,000. Nineteen digits, four trailing zeros (⌊20/5⌋ = 4). Also the last factorial whose exact value fits in a standard 64-bit integer — one reason computers switch to big integers here.

52! ≈ 8.066 × 1067. Sixty-eight digits. If every person alive shuffled a deck once per second since the universe began, the same order would still, with overwhelming probability, never repeat.

Factorials at a glance

Read the digit column as the real story: the values stop being writable, then stop being countable, then stop being storable — while the rule generating them stays one line long. That contrast, a trivial definition with ungraspable output, is why factorials are the standard first warning that growth comes in kinds, and the exponential kind is not the fastest.

nn!Digits
011
51203
103,628,8007
151,307,674,368,00013
202,432,902,008,176,640,00019
2515,511,210,043,330,985,984,000,00026
50≈ 3.04 × 10⁶⁴65
100≈ 9.33 × 10¹⁵⁷158

Frequently asked questions

What is 20 factorial?

20! = 2,432,902,008,176,640,000 — about 2.43 quintillion. It is larger than the number of seconds since the Big Bang by a factor of about five billion, which is why factorials outgrow everyday intuition almost immediately: each step multiplies by a bigger number than the last.

Why is 0 factorial equal to 1?

For the same pattern reason as the zero exponent: 3! = 6, 2! = 2, 1! = 1 — dividing by the next integer each step down gives 0! = 1! ÷ 1 = 1. It is also the right answer combinatorially: there is exactly one way to arrange zero objects (the empty arrangement), and formulas like the binomial coefficient need 0! = 1 to work.

How many trailing zeros does 100! have?

24. A trailing zero needs a factor pair 2 × 5, and 2s are plentiful, so count the 5s: numbers up to 100 contribute ⌊100/5⌋ = 20 fives, plus ⌊100/25⌋ = 4 more from multiples of 25 (which carry two each) — 24 in total. This is Legendre's formula, and it works for any n.

What is the largest factorial a normal calculator can show?

About 170! ≈ 7.26 × 10306 — beyond that, ordinary double-precision numbers overflow (their ceiling is near 1.8 × 10308), which is why standard calculators error at 171!. This page uses exact big-integer arithmetic instead, and computes up to 1000! (2,568 digits) precisely.

Where are factorials used outside maths class?

Anywhere arrangements are counted. A shuffled deck has 52! ≈ 8.07 × 1067 orders — more than atoms in the Earth — so a well-shuffled deck is almost certainly in an order never seen before. Factorials also sit inside probability (lottery odds, permutations and combinations), Taylor series in calculus, and the gamma function that extends them to non-integers.

Note: exact results are given for whole numbers from 0 to 1000. Factorials of negative integers are undefined; non-integer factorials require the gamma function, described in the questions above.

Related tools

Values last verified: 23 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.