Factorial Calculator

Compute n! — the factorial of any whole number — with exact big-integer precision, even for very large n. Free, instant and private: everything runs in your browser.

Results appear instantly up to n = 3,000. Larger values (up to 100,000) are computed exactly when you press Calculate — very large n can take a few seconds.

Try:

How to use the factorial calculator

  1. Enter a whole number. Type any integer from 0 to 100,000 into the box, or click one of the example buttons like 52! (the number of ways to shuffle a deck of cards).
  2. Press Calculate n!. Small values are computed as you type; big ones are computed exactly the moment you press the button.
  3. Copy or download the result. You get every digit of the exact answer, plus the digit count, trailing zeros and a scientific-notation approximation.

About this tool

The factorial of n, written n!, is the product of all positive integers from 1 up to n — so 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorials grow explosively: 20! already exceeds the capacity of a 64-bit integer, and 100! has 158 digits. This factorial calculator uses arbitrary-precision (big-integer) arithmetic with a fast divide-and-conquer product, so it returns the exact value — not a rounded approximation — for any n up to 100,000, a number with 456,574 digits. Factorials appear everywhere in mathematics: counting permutations and combinations, probability, binomial coefficients and Taylor series.

All calculations run locally in your browser using JavaScript's native BigInt support. Nothing you type is sent to a server, the tool is free with no limits, and you can copy the full result to the clipboard or download it as a plain-text file for use in other programs. For related counting problems, try the combinations and permutations calculator.

Frequently asked questions

Why does 0! equal 1?

By convention 0! = 1 because it is an empty product — multiplying no numbers at all leaves the multiplicative identity, 1. This convention also makes the formulas for permutations and combinations work: there is exactly one way to arrange zero objects.

Can I calculate the factorial of a negative or decimal number?

No — the ordinary factorial is only defined for non-negative whole numbers. The Gamma function Γ(x) extends factorials to decimals and complex numbers (with n! = Γ(n + 1)), but this tool focuses on exact integer factorials.

How large a factorial can this tool compute?

Up to n = 100,000, whose factorial has 456,574 digits. The result is exact to the last digit thanks to big-integer arithmetic; only the fixed cap keeps the computation fast in a browser tab.

What do the trailing zeros mean?

Trailing zeros are the zeros at the end of n!. Each one comes from a factor of 10 = 2 × 5, and since factors of 5 are scarcer than factors of 2, the count equals ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … — a classic result used in math competitions.