Factorial Calculator

Enter a whole number n to calculate n!, the product of all whole numbers from 1 to n.

A whole number from 0 to 170. Larger factorials are too big for most calculators.

This result is an estimate only. Double-check important figures before relying on them.

How it is calculated

  • n! = n × (n − 1) × (n − 2) × … × 2 × 1, with 0! = 1
  • The exact value is shown when it has up to 30 digits, and scientific notation after that
  • Trailing zeros = ⌊n ÷ 5⌋ + ⌊n ÷ 25⌋ + ⌊n ÷ 125⌋ + …, because each zero comes from a factor of 10 = 2 × 5

For other calculations, use the scientific calculator.

Worked example

  • 5! = 5 × 4 × 3 × 2 × 1 = 120
  • 10! = 3,628,800
  • 20! = 2,432,902,008,176,640,000
  • 25! has 26 digits and 6 trailing zeros

Why your number may differ

The exact digits are computed with whole-number arithmetic, so they are not rounded. The scientific notation shows only the first digits.

Frequently asked questions

What is a factorial?

The factorial of n, written n!, is the product of all whole numbers from 1 up to n. For example 5! = 5 × 4 × 3 × 2 × 1 = 120.

Why is 0! equal to 1?

By definition, 0! = 1. It keeps formulas for permutations and combinations working, and it is the product of no numbers, which is 1.

Why does it stop at 170?

170! is about 7.26 × 10³⁰⁶, the largest factorial that most calculators and computers can store as an ordinary number. The next one, 171!, is too large.