Life goals

Factorial Calculator

What is the factorial of a number?

Type a whole number like 10. You get 10! — the numbers 10 × 9 × 8 … × 1 multiplied together — which is 3,628,800.

Free, no sign-upPrivate — runs in your browserUpdated November 2026
Answers as you type
More
Type
10!
3,628,800
Exact value
Number of digits
7
Scientific notation
3.6288 × 10⁶
Trailing zeros
2
Step-by-step solution
  1. Multiply every whole number from 10 down to 1: 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1.
  2. Using exact big-integer arithmetic, the product is 3,628,800.
  3. Trailing zeros come from pairs of 2 × 5. Count the factors of 5 (Legendre's formula): ⌊10/5⌋ = 2 → 2 trailing zeros.
  4. Check with Stirling's approximation, n! ≈ √(2πn)·(n/e)n: ≈ 3.5987 × 10⁶ (about 0.83% low, as expected).

Nearby factorials

n!ValueDigits
1!11
2!21
3!61
4!242
5!1203
6!7203
7!5,0404
8!40,3205
9!362,8806
10!3,628,8007

What can I do with my answer?

  1. n! counts the ways to put n different things in order, so 5 books can be lined up in 120 ways.
  2. Remember 0! = 1. It keeps formulas for combinations and probability working.
  3. Factorials grow very fast: 13! is already over 6 billion, so use the digit count to compare big ones.

People also use

Learn more

At a glance

Find the exact factorial of any whole number from 0 to 1000 — every digit, not a rounded estimate — plus its length, trailing zeros and scientific notation. Switch to double factorial for n!!.

Formulan! = n × (n − 1) × (n − 2) × … × 2 × 1,   with 0! = 1
Also searched asfactorial · n factorial · factorial of 100 · double factorial · how to calculate factorial · factorial formula

What is a factorial?

The factorial of a whole number n, written n!, is the product of every whole number from n down to 1. So 4! = 4 × 3 × 2 × 1 = 24. Factorials count arrangements: if you have n different objects, there are n! ways to put them in a row. Four people can stand in line in 24 different orders, and a deck of 52 cards can be shuffled into 52! orders — a 68-digit number.

n! = n × (n − 1) × (n − 2) × … × 2 × 1,   with 0! = 1

Why is 0! equal to 1? There is exactly one way to arrange zero objects (do nothing), and defining 0! = 1 makes formulas such as n! = n × (n − 1)! and the combinations formula work for every case.

How to use the factorial calculator

Enter a whole number from 0 to 1000 and choose n! or Double n!!. The calculator shows the exact result, its number of digits, the value in scientific notation and the number of trailing zeros. When the answer is too long to read comfortably, the headline shows scientific notation and the full number sits in an expandable, scrollable box below the results. A table lists the factorials just below your number, and the steps show the multiplication, the trailing-zero count and a check against Stirling's approximation.

Every value is calculated with exact big-integer arithmetic, so 25!, 100! and 1000! are correct to the last digit.

Worked example

With the default input of 10:

10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800.

It has 7 digits and 2 trailing zeros. The zeros come from the factors 10 = 2 × 5 and 5 × 2 (or 5 × 4), because every trailing zero needs one 2 and one 5. Since 2s are plentiful, you only need to count 5s: ⌊10/5⌋ = 2. For 100!, the count is ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24 trailing zeros, and the full number has 158 digits, starting 9.332621544 × 10¹⁵⁷.

Double factorial

The double factorial n!! multiplies every other number, keeping the same parity as n:

9!! = 9 × 7 × 5 × 3 × 1 = 945    10!! = 10 × 8 × 6 × 4 × 2 = 3,840

Double factorials appear in physics and statistics, for example in moments of the normal distribution and in some integrals. Note that n!! is not (n!)! — that would be astronomically larger.

How big do factorials get?

nn!Digits
51203
103,628,8007
136,227,020,80010
202,432,902,008,176,640,00019
52≈ 8.065817517 × 10⁶⁷68
100≈ 9.332621544 × 10¹⁵⁷158
170≈ 7.257415615 × 10³⁰⁶307
1000≈ 4.023872601 × 10²⁵⁶⁷2,568

Two limits matter in computing. 20! is the largest factorial that fits in a signed 64-bit integer, which is why many programming exercises stop there. 170! is the largest that fits in a standard double-precision floating-point number; 171! overflows, which is why spreadsheets and pocket calculators return an error beyond it. This page avoids both limits.

Where factorials are used

  • Permutations and combinations: choosing and ordering items, such as lottery odds or seating plans. The permutation and combination calculator builds on n!.
  • Probability: the binomial and Poisson distributions use factorials — see the probability calculator.
  • Series in calculus: e = 1/0! + 1/1! + 1/2! + … and the Taylor series for sine and cosine.

Common mistakes

  • Thinking 0! = 0. It is 1.
  • Entering decimals or negatives. Ordinary factorials are defined only for whole numbers 0 and above; the gamma function extends the idea to other numbers.
  • Cancelling too late. For ratios like 100!/98!, cancel first: it is simply 100 × 99 = 9,900.

Sources: definitions follow the NIST Digital Library of Mathematical Functions (§5.4 for factorials and §5.11 for Stirling's formula); trailing-zero counting uses Legendre's formula, standard in number theory texts.

Checked by the Calcivia team using our checking rules · Last updated .
Cite or link to this page

Using this factorial calculator in an article, report or homework? Copy a citation or a ready-made link:

APACalcivia. (2026). Factorial Calculator. Retrieved November 11, 2026, from https://www.calcivia.com/factorial-calculator/
MLA"Factorial Calculator." Calcivia, 2026, https://www.calcivia.com/factorial-calculator/. Accessed 11 Nov. 2026.
HTML link<a href="https://www.calcivia.com/factorial-calculator/">Factorial Calculator</a> by Calcivia
Did this help you?

Questions people ask

What is 0 factorial?

0! equals 1. There is exactly one way to arrange nothing, and this definition keeps formulas like n! = n × (n − 1)! consistent.

What is the factorial of 100?

100! is about 9.332621544 × 10^157. It has 158 digits and ends in 24 zeros; enter 100 above to see every digit.

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

Not with the ordinary factorial. The gamma function extends factorials to fractions, for example Γ(1.5) = 0.5! ≈ 0.886, but it is undefined at negative integers.

Why do calculators say 171! is an error?

Most calculators use double-precision numbers that top out around 1.8 × 10^308. 170! is about 7.26 × 10^306, but 171! is about 1.24 × 10^309, which is too big.

How many trailing zeros does n! have?

Add ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … until the terms reach zero. For 1000! that is 200 + 40 + 8 + 1 = 249 zeros.