Factorial Calculator

Calculate factorials.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter a whole number n to get n!, the product 1 × 2 × … × n. 10! is 3,628,800, and big values such as 100! come with their digit count and trailing zeros.

How to use

1
Step 1
Enter a whole number n of 0 or more.
2
Step 2
Press Calculate.
3
Step 3
Read the factorial, plus its digit count for large n.

How it works

n! counts the ways to arrange n distinct items. By definition 0! = 1. Factorials grow very fast: 20! already has 19 digits and 100! has 158. Trailing zeros come from factors of 10, so there are ⌊n/5⌋ + ⌊n/25⌋ + … of them.

n! = n × (n − 1) × … × 2 × 1      0! = 1      zeros = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …

Worked example

100 factorial

Input
n = 100
Output
9.332621 × 10^157 (158 digits, 24 trailing zeros)
Walkthrough
Trailing zeros: ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24.

Limitations

  • n must be a whole number of 0 or more, up to 5,000. Larger values are refused.
  • Very large results are shown in scientific notation alongside the digit count.

Questions

What is 5 factorial?
120.
What is 20 factorial?
2,432,902,008,176,640,000.
What is 0 factorial?
1, by definition.
How many digits does 1000! have?
2,568 digits, and 249 trailing zeros.

Features

  • Digit count and trailing zeros
  • Up to 5,000!
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • The essence of calculus

    3Blue1Brown

    Visual calculus story that complements symbolic solvers.

    Watch on YouTube
  • Finding mean, median, and mode

    Khan Academy

    Stats buttons on scientific calculators need this framing.

    Watch on YouTube
  • Scientific Notation

    Math is Fun

    Powers of ten for scientific calculator displays.

  • Data Index

    Math is Fun

    Stats and probability explainers for data tools.