Factorial Calculator

Find the exact value of n! for any whole number up to 5,000, or a multifactorial such as n!!, with the number of digits, trailing zeros and scientific notation.

20!2,432,902,008,176,640,000

Whole number from 0 to 5,000.

1 – 100

20!

2,432,902,008,176,640,000

  • Number of digits19
  • Scientific notation2.432902008 × 10¹⁸
  • Trailing zeros4
  • Factors multiplied20

Computed exactly with integer arithmetic. 0! = 1 by convention (empty product). Trailing zeros equal ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … (Legendre's formula).

How this was calculated

n! = n × (n − 1) × … × 1

20! = 20 × 19 × 18 × 17 × … × 1

= 2,432,902,008,176,640,000 (19 digits).

Definitions

n! = n × (n − 1) × … × 2 × 1, and 0! = 1 because it is an empty product. In terms of the gamma function, n! = Γ(n + 1).

A multifactorial counts down in steps of k: n!(k) = n × (n − k) × (n − 2k) × …, stopping at the last positive term. The double factorial n!! uses k = 2, so 7!! = 7 × 5 × 3 × 1 = 105 and 8!! = 8 × 6 × 4 × 2 = 384. It is not the same as (n!)!.

Worked example

20! = 20 × 19 × … × 1 = 2,432,902,008,176,640,000. That is 19 digits with 4 trailing zeros, or about 2.432902008 × 10¹⁸.

100! has 158 digits. By Legendre's formula it has ⌊100/5⌋ + ⌊100/25⌋ = 24 trailing zeros, because each zero needs a factor of 5 paired with a factor of 2.

Exact arithmetic and limits

Every digit is computed with exact integer arithmetic; nothing is rounded. When the result is too long for the headline, the headline shows scientific notation and the table below lists every digit, with a CSV download. The limit of n = 5,000 (a 16,326-digit answer) keeps the page fast.

How to use the Factorial Calculator

Enter n and, optionally, the step.

  1. Enter n

    Type a whole number from 0 to 5,000.

  2. Choose the step

    Leave k = 1 for n!, or use 2 for a double factorial, 3 for a triple factorial, and so on.

  3. Read the result

    See the exact value, digit count, trailing zeros and scientific notation.

References

Frequently asked questions

Why is 0! equal to 1?

0! is the empty product, and defining it as 1 keeps formulas such as n! = n × (n − 1)! and C(n, 0) = 1 consistent.

How many digits does 1000! have?

2,568 digits, with 249 trailing zeros.

Can I take the factorial of a decimal or negative number?

Not with this tool. For non-integers, n! extends to the gamma function Γ(n + 1). It is undefined at negative integers.

Last updated . Results are estimates for informational purposes only.