Factorial calculator
Enter a whole number n from 0 to 10,000. The calculator multiplies out n! exactly with big-integer arithmetic and shows the number of digits, how many zeros it ends with, and the double factorial n!!.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Enter n, a whole number between 0 and 10,000.
- n! is shown in full when it has up to 24 digits, otherwise in scientific notation with 15 significant digits, followed by the exact value.
- For very long results the page shows the first 1,000 digits; the Copy button copies every digit.
How it works
n! is computed by multiplying 1 × 2 × … × n with arbitrary-precision integers, so there is no rounding. The digit count is the length of the result, the trailing zeros come from the factors of 5, and the double factorial multiplies n × (n−2) × (n−4) × … down to 1 or 2.
Worked example
25! = 15,511,210,043,330,985,984,000,000: 26 digits, 6 trailing zeros (25/5 = 5 plus 25/25 = 1), and 25!! = 7,905,853,580,625.
10,000! has 35,660 digits and ends with 2,499 zeros (2000 + 400 + 80 + 16 + 3).
Tips
- n! grows faster than any exponential: 20! is about 2.4 × 10^18 and 70! already passes 10^100.
- Binomial coefficients are quotients of factorials: C(n, k) = n! / (k! (n−k)!).
Frequently asked questions
What is a factorial?
n! is the product of all whole numbers from 1 to n, so 5! = 1 × 2 × 3 × 4 × 5 = 120. By definition 0! = 1. Factorials count the ways to arrange n different objects in a row.
Why is the limit 10,000?
10,000! already has 35,660 digits. Beyond that the page would take noticeably longer and the result would be too long to be useful. Up to that limit every digit is exact.
How many zeros does n! end with?
Each trailing zero comes from a factor 10 = 2 × 5, and there are always more 2s than 5s, so the count is the number of factors of 5 in n!: floor(n/5) + floor(n/25) + floor(n/125) + and so on. 100! ends with 24 zeros.
What is a double factorial?
n!! multiplies every second number down from n: 7!! = 7 × 5 × 3 × 1 = 105 and 8!! = 8 × 6 × 4 × 2 = 384. It is not the factorial of a factorial. By convention 0!! = 1.
Can I take the factorial of a decimal or a negative number?
Not here. The factorial is defined for whole numbers 0 and up. A smooth extension to other numbers, the gamma function, exists, but this tool only handles whole numbers.