Skip to content

Factorial Calculator

Calculate n! exactly, up to 10,000!, with its number of digits and trailing zeros.

A whole number from 0 to 10,000.

Result

Enter your values and select Calculate to see the result.

Runs in your browser — nothing you enter is sent to a server.

How the Factorial Calculator works

n! (n factorial) multiplies every whole number from 1 to n; 0! is 1. Factorials grow very fast, so the calculator uses exact big-integer arithmetic and shows the number of digits and trailing zeros. Very long results are shown in scientific form, with every digit listed below when there are up to 3,000.

Formulas

Factorial

n! = 1 × 2 × 3 × … × n

Trailing zeros (Legendre)

⌊n ÷ 5⌋ + ⌊n ÷ 25⌋ + ⌊n ÷ 125⌋ + …

Each zero needs a 2 and a 5; fives are the rarer factor.

Examples

Small factorials

5! = 120 and 20! = 2,432,902,008,176,640,000.

100!

100! has 158 digits and ends in 24 zeros; 1,000! ends in 249 zeros.

Frequently asked questions

Where are factorials used?

Counting arrangements: n different items can be ordered in n! ways. They also appear in probability and series.

Why is 0! equal to 1?

There is exactly one way to arrange nothing, and it keeps formulas like n! = n × (n − 1)! true.

What about factorials of decimals?

They use the gamma function, which this calculator doesn't cover.

Exponent Calculator

Raise any number to a power, with every digit of large whole-number results.

Math Tools

Prime Number Checker

Check whether a number is prime and see its prime factorization, divisors and the nearest primes.

Math Tools