Toolstia / Factorial calculator
Factorial calculator
The factorial of a number n, written n!, is the product of all whole numbers from 1 to n. Enter a number and see the exact value, how many digits it has and how many zeros it ends with.
Enter a whole number from 0 to 5000.
n! means n × (n−1) × … × 1, and 0! is 1. Factorials grow fast: 20! is about 2.4 quintillion and 100! has 158 digits.
How it works
- Enter a whole number from 0 to 5000.
- Read the digits, trailing zeros and scientific notation.
- Copy the full number if you need it.
What a factorial is
n! = n × (n − 1) × … × 2 × 1. For example 5! = 120. By convention 0! = 1, which keeps formulas for permutations and combinations working.
Exact, not approximate
Most calculators switch to scientific notation after about 170!. This one uses big-integer arithmetic and shows every digit, so 100! is the full 158-digit number.
Trailing zeros
Each trailing zero comes from a factor of 10, which is a 2 times a 5. There are always more 2s than 5s, so the count equals the number of times 5 divides the product: n ÷ 5 + n ÷ 25 + n ÷ 125 + …, rounded down.
Where factorials are used
They count arrangements in permutations and combinations, appear in probability, and form the terms of series such as the one for e.
Questions
Can I take the factorial of a decimal or negative number?
Not with this tool. Factorials are defined for whole numbers from 0 up here.
Why stop at 5000?
5000! already has over 16,000 digits. Larger values would slow your browser.
Is anything uploaded?
No. Your number stays in your browser and is never sent anywhere.