Primality test for huge numbers, prime factorization and nearest primes
Factorial Calculator
See the full, exact value of a factorial, not a rounded approximation.
Loading tool…
How to use factorial calculator
Choose n!, n!!, Permutations or Combinations.
Enter n (and r for permutations or combinations).
Read the digit count, trailing zeros and the approximate size.
Expand or copy the exact value.
What this tool does
- Exact factorials up to 25,000! (99,094 digits), computed by binary splitting in milliseconds.
- Digit count, trailing zeros and leading digits for n up to 10,000,000 without computing the whole number.
- Double factorials, permutations P(n, r) and combinations C(n, r), all exact.
- Whole numbers are handled with exact BigInt arithmetic in the browser, so long results are never rounded or cut to 15 or 16 digits the way ordinary calculators do.
How the result is verified
The trailing zero count comes from Legendre's formula and is compared with the zeros at the end of the computed number. Known values to check against: 10! = 3,628,800, 20! = 2,432,902,008,176,640,000, and 100! has 158 digits ending in 24 zeros.
Frequently asked questions
Why is 0! equal to 1?
There is exactly one way to arrange zero objects (do nothing), and keeping 0! = 1 makes formulas such as n! = n x (n - 1)! and C(n, 0) = 1 work without exceptions.
How many trailing zeros does a factorial have?
Each zero comes from a factor of 10, which needs a 2 and a 5. Fives are rarer, so count them: floor(n/5) + floor(n/25) + floor(n/125) and so on. 100! has 20 + 4 = 24 trailing zeros.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Powers with exact big results, nth roots and simplest radical form
Trig, logs, powers and factorials with memory, history and keyboard input
Greatest common divisor and least common multiple with Euclid's steps