Skip to main content
🔢 Combinatorics

Factorial Calculator

Compute n! — the product of all integers from 1 to n — exactly, with big-integer precision, plus scientific notation, the number of digits, and the count of trailing zeros.

Exact n!
Big-integer math
Scientific notation
Digits & zeros
100% Free
🔢 Open All Math Calculators 📖 Read the Guide

Factorial — Quick answer

n! multiplies together every whole number from 1 up to n.

n! = 1 × 2 × 3 × … × n  ·  n! = n × (n−1)!  ·  0! = 1

Worked example: 5! = 120 · 10! = 3,628,800 · 0! = 1.

Factorial quick reference

nn!Trailing zeros
51201
103,628,8002
136,227,020,8002
202,432,902,008,176,640,0004

Factorials grow faster than any exponential — note how quickly the digits pile up.

🔢 Factorial Calculator

Enter a whole number n from 0 to 170. The exact value is computed with big-integer math.

n! (exact)
Scientific notation
Number of digits
Trailing zeros

ℹ️ The factorial is defined only for non-negative integers, with 0! = 1. The cap of 170 keeps the result readable; beyond it the value has hundreds of digits.

A factorial, written n!, is the product of all positive integers from 1 up to n: 5! = 1 × 2 × 3 × 4 × 5 = 120. By definition 0! = 1, and each step follows the rule n! = n × (n−1)!. Factorials grow astonishingly fast, so this calculator uses exact big-integer arithmetic to keep every digit correct, and also reports the digit count, scientific notation, and trailing zeros.

Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: the factorial definition and Legendre's formula for trailing zeros, recomputed in code.

Definition and key facts

Definition
n! = 1 × 2 × 3 × … × n
Recurrence
n! = n × (n−1)!  ·  0! = 1
Trailing zeros
⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …

Each factorial builds on the last, which is why they explode in size: multiplying by an ever-larger n every step. The trailing zeros come from factors of 10 = 2 × 5 in the product; since there are always more 2s than 5s, you just count the 5s with Legendre's formula. Factorials are defined only for whole numbers ≥ 0 — the gamma function generalises them to other values.

Worked example — 5!, 10! and 20!

Scenario: three factorials showing how fast they grow.

5!
1 × 2 × 3 × 4 × 5 = 120
10!
10 × 9 × … × 1 = 3,628,800
20!
2,432,902,008,176,640,000 (19 digits)

5! is 120; multiplying on up to 10 gives 3,628,800; by 20! the answer is already a 19-digit number, 2,432,902,008,176,640,000. That value is past the safe range of ordinary floating-point numbers, which is exactly why exact big-integer math matters. 10! ends in 2 zeros (⌊10/5⌋ = 2) and 20! ends in 4 (⌊20/5⌋ = 4), as the calculator confirms.

Frequently Asked Questions

What is a factorial?

n! is 1 × 2 × … × n. So 5! = 120 and 4! = 24. Each is the previous times n: 5! = 5 × 4!. It counts orderings of n items.

Why is 0! equal to 1?

It's the empty product (= 1) and keeps n! = n × (n−1)! valid at n = 1. It also makes nPr and nCr formulas work.

How big do factorials get?

Fast: 10! = 3,628,800, 13! = 6,227,020,800, 20! = 2,432,902,008,176,640,000. Exact big-integer math keeps all digits right.

How many trailing zeros does n! have?

⌊n/5⌋ + ⌊n/25⌋ + … 10! has 2 zeros; 25! has 5 + 1 = 6. Zeros come from 2×5 pairs, and 5s are scarcer.

What are factorials used for?

Permutations, combinations, probability, series like eˣ, and the binomial theorem. Defined only for integers ≥ 0.

Need more math tools?

Explore permutations, exponents, probability, scientific notation and more across the AI Calculator math suite.

🔢 Open Math Calculators — Free

No registration required · 350+ calculators · PDF report export