Skip to content
toolgrid

No tool found. Try another word.

Factorial Calculator

Calculate n! exactly for any n from 0 to 1000, with every digit, the number of digits and the trailing zeros.

Enter a whole number from 0 to 1000.

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the Factorial Calculator

  1. 1 Enter a whole number n from 0 to 1000.
  2. 2 Read n! with every digit, how many digits it has and how many zeros it ends with.
  3. 3 Copy the result or download it as a text file.

About the Factorial Calculator

The factorial of n, written n!, is the product of all whole numbers from 1 to n: 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition 0! = 1. Factorials grow extremely fast: 10! is 3,628,800, 20! already has 19 digits and 100! has 158.

Ordinary calculators switch to rounded scientific notation around 20!, but this calculator uses exact big-number arithmetic, so you see every digit, up to 1000!, which has 2568 digits.

The number of trailing zeros of n! equals the number of times 5 occurs as a factor in 1 × 2 × … × n, because every zero comes from a pair 2 × 5 and there are always more 2s than 5s. That count is n/5 + n/25 + n/125 + … (rounded down), so 100! ends in 20 + 4 = 24 zeros. Factorials count arrangements: n different things can be ordered in n! ways.

Frequently asked questions

Why is 0! equal to 1?

There is exactly one way to arrange zero objects (do nothing), and the rule n! = n × (n − 1)! only works for n = 1 if 0! = 1.

How many digits does 100! have?

158 digits, and it ends in 24 zeros.

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

The factorial is only defined for whole numbers 0 and up. The gamma function extends it to other numbers, but that is not what this calculator does.

What are factorials used for?

Counting: the number of ways to order n items is n!, and combinations and permutations (as in lotteries) are built from factorials.

How do you count the trailing zeros?

Add n/5, n/25, n/125, … rounded down. For 1000! that is 200 + 40 + 8 + 1 = 249 zeros.