Your result will appear here
Fill in the fields and press Calculate.
A factorial (n!) is the product of all whole numbers from 1 up to n, and it is the building block of probability, permutations, combinations and counting problems. Its value grows astonishingly fast: 5! is only 120, but 10! exceeds three million and 20! is an eighteen-digit number. That growth overflows most calculators — this tool gives an exact result even for large numbers.
Enter a number and n! is computed exactly.
Factorial Calculator: step-by-step worked example
In how many orders can 7 different books be arranged on a shelf? The answer is 7!
- Number (n)
- 7
- 1
Write out the definition
n! = n × (n − 1) × … × 2 × 1
= 7 × 6 × 5 × 4 × 3 × 2 × 1
- 2
The previous factorial
(n − 1)!
= 720
- 3
Do the last multiplication
n! = n × (n − 1)!
7 × 720 = 5,040
- 4
Trailing zeros
⌊n ÷ 5⌋ + ⌊n ÷ 25⌋ + ⌊n ÷ 125⌋ + …
= 1
- 5
Number of digits
How many digits the result has
= 4
- n!:1 → 5,040
Good to know: By definition 0! = 1. Factorials outgrow even exponentials: 10! = 3,628,800 and 20! ≈ 2.4 × 10¹⁸. Trailing zeros come from 2 × 5 pairs, so counting the fives is enough.
Factorial Calculator — how it works
Definition
n! = n × (n−1) × (n−2) × … × 2 × 1. For example 5! = 5 × 4 × 3 × 2 × 1 = 120.
Special cases
- 0! = 1. Zero factorial is defined as 1 (the empty product). This is required for the combination and permutation formulas to work consistently.
- 1! = 1.
- Negative and non-integer numbers have no factorial in the basic definition.
How fast does it grow?
| n | n! |
|---|---|
| 5 | 120 |
| 10 | 3,628,800 |
| 13 | 6,227,020,800 |
| 20 | 2,432,902,008,176,640,000 |
13! no longer fits on a calculator display; 20! has eighteen digits. This faster-than-exponential growth is why factorials involve very large numbers — the tool uses exact integer arithmetic with no loss of digits.
Where it is used
- Permutations: all arrangements of n distinct objects total n!.
- Combination and permutation formulas: C(n,r) and P(n,r) are defined with factorials.
- Probability: the denominators of arrangement and selection problems.
For direct selection and arrangement use a combination calculator and a permutation calculator.
Worked example
Take 5!: 5 × 4 × 3 × 2 × 1 = 120 — exactly the number of ways five people can line up in a row. To see how fast it grows: 10! = 3,628,800 (arrangements of ten people), 13! = 6,227,020,800 (now ten digits). Because each step multiplies the previous by n, the value compounds: going from 5! to 10! multiplies the result by more than 30,000. And remember 0! is defined as 1 — required for the consistency of the selection formulas.
Factorial table (1! – 18!)
| n! | Value |
|---|---|
| 1! | 1 |
| 2! | 2 |
| 3! | 6 |
| 4! | 24 |
| 5! | 120 |
| 6! | 720 |
| 7! | 5,040 |
| 8! | 40,320 |
| 9! | 362,880 |
| 10! | 3,628,800 |
| 11! | 39,916,800 |
| 12! | 479,001,600 |
| 13! | 6,227,020,800 |
| 14! | 87,178,291,200 |
| 15! | 1,307,674,368,000 |
| 16! | 20,922,789,888,000 |
| 17! | 355,687,428,096,000 |
| 18! | 6,402,373,705,728,000 |
Frequently asked questions
How is a factorial calculated?+
n! is the product of all whole numbers from 1 up to n: 5! = 5×4×3×2×1 = 120. The tool returns the exact value even for large n, with no loss of digits.
Why does 0! equal 1?+
By definition the empty product is 1. Also, 0! must equal 1 for combination and permutation formulas (like C(n,n)=1) to remain consistent.
How fast does a factorial grow?+
5! = 120, 10! ≈ 3.6 million, and 20! is an eighteen-digit number. Because each step multiplies by n, it grows faster than exponentially, which is why large n needs special computation.
Does a negative or decimal number have a factorial?+
Not in the basic definition — factorials are defined only for 0 and positive integers. (Advanced maths extends this with the gamma function, but this tool works with integers.)
Where are factorials used?+
In arrangement (permutation) and selection (combination) problems, probability, and series expansions. All arrangements of n distinct objects total exactly n!.
Why does my calculator error on large factorials?+
Most calculators round or overflow past a certain number of digits. This tool uses exact integer arithmetic, so it computes even very large values like 100! precisely.
About this page
- Publisher:
- Kalkoro — Teknolojig Bilişim Teknolojileri A.Ş., İstanbul
- Written by:
- Ahmet Tur — Editor (Math, date & time, unit conversion, physics & chemistry, everyday tools)
- Reviewed by:
- Kübra Yıldız — Editor
Parameters come from official sources; the last update date is shown at the bottom of the page.
Spotted a wrong result? Use the "Report a bug" button at the top of the page; every report is reviewed.
How we calculate and our accuracy policy →
Results are for information only. For official matters the relevant authority's calculation prevails.
Last updated: