Factorial Calculator
A factorial multiplies every whole number from your value down to one. It counts the ways a set can be arranged, and it grows faster than almost anything else in elementary maths.
Formula
n! = n × (n − 1) × (n − 2) × … × 1
- 0! = 1 by definition
- Permutations: nPr = n! ÷ (n − r)!
- Combinations: nCr = n! ÷ (r! × (n − r)!)
5! = 5 × 4 × 3 × 2 × 1 = 120
What a Factorial Is
n! = n × (n−1) × (n−2) × ... × 1
5! = 5 × 4 × 3 × 2 × 1 = 120.
It counts arrangements: five books can be shelved in 120 distinct orders. Ten books give 3,628,800 — and a standard deck of 52 cards has 52! possible orders, a number with 68 digits.
By convention 0! = 1, because there is exactly one way to arrange nothing.
Permutations and Combinations
Permutations (order matters): P(n,r) = n! ÷ (n−r)!
Combinations (order does not): C(n,r) = n! ÷ [r!(n−r)!]
Choosing 3 people from 10 for a podium gives 720 permutations; choosing 3 for an unranked committee gives only 120 combinations, because each group of three is counted once rather than six times.
How Quickly It Explodes
Factorial growth outruns exponential growth comfortably. 10! is 3.6 million; 20! is about 2.4 quintillion; 70! exceeds the range of a standard double-precision float, which is why calculators report an overflow beyond it.
This is also why brute-force approaches to problems like the travelling salesman become impossible so quickly: 20 cities give 20! possible routes, and no amount of computing power exhausts them.
Quick Reference
| n | n! | Meaning |
|---|---|---|
| 0 | 1 | The empty arrangement |
| 5 | 120 | Orderings of 5 items |
| 10 | 3,628,800 | Orderings of 10 items |
| 15 | 1,307,674,368,000 | Over a trillion |
| 20 | 2,432,902,008,176,640,000 | Beyond exact integers in most calculators |
Frequently Asked Questions
- What is 0 factorial?
- One. There is exactly one way to arrange an empty set, and the convention keeps the permutation and combination formulas consistent.
- What is the difference between permutations and combinations?
- Permutations count arrangements where order matters; combinations count selections where it does not. Choosing 3 from 10 gives 720 permutations but 120 combinations.
- Can you take the factorial of a decimal?
- Not directly, but the gamma function extends the idea to non-integers and is what calculators use for such inputs.
- Why does my calculator show an error for large factorials?
- Factorials grow extremely fast. Beyond about 70! the result exceeds the range of standard floating point numbers.