Factorial Calculator
A factorial multiplies every whole number from 1 up to n: 5! = 1 × 2 × 3 × 4 × 5 = 120. It counts the ways n distinct things can be put in order, which is why it turns up inside every combination and permutation formula. The numbers get astronomical fast, and most calculators give up and round — a JavaScript number stops holding whole numbers exactly at 9,007,199,254,740,991, which 19! already exceeds. This one uses arbitrary-precision arithmetic instead, so 100! is shown as all 158 of its digits rather than as "about 9.33 × 10^157", alongside its digit count, its scientific notation, and the number of zeros it ends in.
- Accurate
- Real-time
- Easy to use
- 100% free
100!
9332621544394415 … 0000000000000000
Number of digits
158
Details
Updates as you typeA whole number from 0 to 10,000. 0! and 1! are both 1 — that is a definition, not a bug.
Summary
n factorial
9332621544394415 … 0000000000000000
- Exact value
- 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
- Number of digits
- 158
- Scientific notation
- 9.33262 × 10^157
- Trailing zeros
- 24
- As a JavaScript number
- Wrong — right to about 15 significant figures, invented after that
- Nearest double
- 9.332622e+157
- Factors of 2 in n!
- 97
- 100! has 158 digits, so the middle of it is elided above — the first 16 and the last 16 are shown. Every digit is known exactly; there are simply too many of them to put on a page. Results up to 44 digits are printed in full.
- This value is computed with BigInt arithmetic, so every digit above is exact. An ordinary JavaScript number holds whole numbers exactly only up to 9,007,199,254,740,991, and 19! = 121,645,100,408,832,000 already passes it. Factorials collect enough factors of 2 to survive as doubles a little past that by luck — 22! is the last one stored exactly — but 23! comes back as 25,852,016,738,884,978,212,864 when the true value is 25,852,016,738,884,976,640,000, and it only gets worse from there.
- Factorials grow faster than any exponential: 10! is about 3.6 million, 20! is about 2.4 × 10^18, and 100! is already larger than the estimated number of atoms in the observable universe.
How this is calculated
- n
- 100
- Definition
- n! = 1 × 2 × 3 × … × n, with 0! = 1
- Multiplied out
- 1 × 2 × 3 × … × 99 × 100
- Exact value of 100!
- 9332621544394415 … 0000000000000000
- Number of digits
- 158
- Scientific notation
- 9.33262 × 10^157
- Trailing zeros, without computing the factorial
- A zero comes from a factor of 10 = 2 × 5, and fives are scarcer than twos, so count the fives: floor(n/5) + floor(n/25) + floor(n/125) + …
- floor(100 / 5)
- 20
- floor(100 / 25)
- 4
- Trailing zeros
- 24
Compare scenarios
See how one change moves the result
- CurrentYour inputs as they stand9332621544394415 … 0000000000000000Current
- n — the number to take the factorial of1251882677176888926 … 0000000000000000
Frequently asked questions
Why is 0! equal to 1?
Because it is the only value that keeps everything else consistent. n! counts the orderings of n things, and there is exactly one way to arrange an empty collection: do nothing. The recurrence n! = n × (n − 1)! also demands it — at n = 1 it reads 1! = 1 × 0!, so 0! must be 1 for 1! to come out as 1. And the binomial coefficient C(n, 0), the number of ways to choose nothing, is 1 for every n, which needs 0! = 1 in its denominator. Mathematically it is the empty product: multiplying no numbers together gives the multiplicative identity, 1, in the same way that adding no numbers gives 0.
What is the factorial of a negative number?
There is not one. The gamma function Γ is the standard continuous extension of the factorial, with Γ(n + 1) = n! for whole n, and it has poles — points where it shoots off to infinity — at 0, −1, −2, −3 and every other non-positive integer. So there is no finite value to report for (−3)!, and this calculator says so rather than inventing one. Negative non-integers do have gamma values: Γ(−0.5) = −2√π ≈ −3.545, for instance. This page rejects those too, but for a different reason: they can only be produced by numerical approximation, and the whole point here is exact digits.
Can I take the factorial of a decimal like 4.5?
Not here. The gamma function gives 4.5! = Γ(5.5) ≈ 52.3428, so the question has an answer, but that answer is a limit computed by approximation — it has no exact decimal or fractional form, and it cannot be printed digit for digit the way 100! can. Since this calculator exists specifically to show every digit exactly, it refuses non-integers instead of quietly switching to a different function and a different standard of accuracy. If you need Γ, use a numerical library and expect about 15 significant figures.
How many zeros does 100! end in?
Exactly 24, and you can work that out without computing 100! at all. Each trailing zero comes from a factor of 10, which is 2 × 5. Factors of 2 are far more common in a factorial than factors of 5 — 100! contains 97 twos and only 24 fives — so the fives are the limiting ingredient and the zero count equals the number of fives. Legendre's formula counts them: floor(100/5) + floor(100/25) = 20 + 4 = 24. The multiples of 25 are counted twice because they each contribute two fives. For 1000! the same sum gives 200 + 40 + 8 + 1 = 249.
Why do other calculators show factorials as approximations?
Because they compute in floating point, and the ceilings arrive early. A double holds whole numbers exactly only up to 2^53 − 1 = 9,007,199,254,740,991, and 18! = 6,402,373,705,728,000 is the largest factorial under that; 20! = 2,432,902,008,176,640,000 is the largest that fits in a signed 64-bit integer. Factorials collect factors of 2, which a binary mantissa stores for free, so 22! still lands exactly by luck — but 23! comes back as 25,852,016,738,884,978,212,864 when the true value is 25,852,016,738,884,976,640,000, wrong from the seventeenth digit on. Past 170! a double overflows to Infinity entirely. This page uses BigInt, which has no fixed width and grows to whatever the answer needs, so 1000! comes back as a specific 2,568-digit integer rather than an estimate. Anything showing you fifty digits out of double arithmetic is making most of them up.
How large a factorial will this calculate?
10,000!, which is a 35,660-digit number. The limit is about responsiveness rather than correctness: the result recomputes on every keystroke, and while a fast binary-splitting product gets 10,000! in well under a millisecond, converting it to decimal digits for display takes a couple more, and both costs grow faster than n does. Past roughly 20,000 the delay becomes noticeable while typing. Results up to 200 digits are printed in full; longer ones have their middle elided, with the first and last 60 digits shown, since the digit count and the two ends are what anyone actually reads.