Skip to content

Factorial calculator

Calculate the exact factorial of any whole number from 0 to 5000, see how many digits it has and how many zeros it ends with, and copy the full result.

  • Free, no limits
  • No sign-up
Everything happens in your browser; your data is never uploaded.
  • ✓ Free
  • ✓ No sign-up
  • ✓ Nothing uploaded

Next step

What to do next

How to use it

  1. Enter a whole number n from 0 to 5000.
  2. Read the exact value of n!.
  3. Check the digit count, trailing zeros and scientific notation.
  4. Copy the full number if you need it.
Try it now

What a factorial is

The factorial of a whole number n, written n!, is the product of all positive whole numbers from 1 to n:

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

  • 5! = 5 × 4 × 3 × 2 × 1 = 120
  • 10! = 3,628,800
  • 0! = 1 by definition

Factorials grow extremely fast. This calculator uses exact big-integer arithmetic, so even 5000! (a number with 16,326 digits) is calculated exactly in your browser, with no rounding.

Factorial table

nn!
01
11
5120
103,628,800
136,227,020,800
202,432,902,008,176,640,000
52≈ 8.0658 × 10⁶⁷
70≈ 1.1979 × 10¹⁰⁰

20! is the largest factorial that fits in a standard 64-bit integer, and 70! is the first one larger than a googol (10¹⁰⁰). 52! is the number of ways to shuffle a deck of cards, so a well-shuffled deck is almost certainly in an order no one has seen before.

Why 0! = 1

There is exactly one way to arrange zero objects: do nothing. Defining 0! = 1 also keeps formulas consistent. The rule n! = n × (n − 1)! gives 1! = 1 × 0!, which only works if 0! = 1, and the combination formula C(n, n) = n! / (n! × 0!) correctly gives 1.

Factorials are only defined for non-negative whole numbers in this calculator. (The gamma function extends them to other values, but that is beyond this tool.)

Trailing zeros

The calculator counts the zeros at the end of n!. Each trailing zero comes from a factor of 10 = 2 × 5, and since there are always more 2s than 5s, you only need to count the 5s:

zeros = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …

For 100!: 20 + 4 = 24 trailing zeros. 100! has 158 digits in total.

Where factorials are used

  • Arrangements: 5 books can be lined up on a shelf in 5! = 120 ways.
  • Combinations and permutations: C(n, r) = n! / (r! (n − r)!). The probability calculator handles these directly.
  • Probability: the chance of a random shuffle putting 10 cards in one particular order is 1 / 10! = 1 in 3,628,800.
  • Series in calculus: e = 1/0! + 1/1! + 1/2! + 1/3! + …, and sin, cos and eˣ have similar factorial series.

Tips

  • The result box scrolls, and the copy button copies the full number without separators.
  • For quick small factorials inside other calculations, type n! in the scientific calculator.
  • For n up to 12, the calculator also writes out the full product, such as 6 × 5 × 4 × 3 × 2 × 1 = 720.
  • Very large factorials take a moment to display; 5000! is a wall of 16,326 digits, so use the digit count and scientific notation for a quick sense of its size.
  • To estimate a factorial without computing it, Stirling's approximation n! ≈ √(2πn) × (n/e)ⁿ is accurate to within about 1% for n = 10 and gets better as n grows.
  • In spreadsheets, the FACT function returns the same values but switches to rounded floating point above 20!, while this tool stays exact. Everything is calculated locally in your browser, so even the largest results never leave your device.

Frequently asked questions

What is 0 factorial?

0! = 1. There is exactly one way to arrange nothing, and the definition keeps factorial formulas consistent.

What is 10 factorial?

10! = 3,628,800.

Can I calculate factorials of negative numbers or decimals?

No. This calculator handles whole numbers from 0 to 5000; factorials of negative integers are undefined.

How many digits does 100! have?

158 digits, ending in 24 zeros.

Why are the results exact?

The calculator uses big-integer arithmetic instead of floating point, so every digit is correct.

Last updated: November 12, 2026

Recommended

Similar tools

If Factorial calculator helped, you may need these too.

See all in category →

People also use