Factorial Calculator
The factorial calculator multiplies every whole number from 1 to n: 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720. It works for any n from 0 to 170, and 0! = 1 by definition.
Sources: Wikipedia, MDN Updated
Calculate the factorial of any non-negative integer and see the complete multiplication sequence.
How to calculate a factorial
6! (read "6 factorial") multiplies every whole number from 6 down to 1.
- Start with n: 6.
- Multiply by each smaller whole number in turn: 6 × 5 = 30, × 4 = 120, × 3 = 360, × 2 = 720.
- The final × 1 changes nothing, so 6! = 720.
The tool shows this running product for any input of 10 or less. Above 10 it shows only the expansion and the total, because the list would run to dozens of lines.
Why 0! = 1
A factorial counts the ways to put n items in order. There is exactly one way to arrange no items, so 0! = 1, and one way to arrange one item, so 1! = 1. The calculator returns 1 for both by definition.
The same rule keeps the formula for combinations working when you choose all the items or none of them; the permutation and combination calculator uses it.
Factorial table from 0! to 12!
| n | n! | n | n! |
|---|---|---|---|
| 0 | 1 | 7 | 5,040 |
| 1 | 1 | 8 | 40,320 |
| 2 | 2 | 9 | 362,880 |
| 3 | 6 | 10 | 3,628,800 |
| 4 | 24 | 11 | 39,916,800 |
| 5 | 120 | 12 | 479,001,600 |
| 6 | 720 |
Why the calculator stops at 170
170! is about 7.26 × 10³⁰⁶, the largest factorial that fits in a JavaScript number. 171! is about 1.24 × 10³⁰⁹, which is more than Number.MAX_VALUE, roughly 1.8 × 10³⁰⁸.
Instead of returning Infinity, the tool rejects inputs above 170. Results this large are shown in powers of ten; the scientific notation converter explains the format.
Where factorials are used
Factorials count arrangements: n! orders of n items, and the building blocks of nPr and nCr. To see the groups instead of counting them, the all possible combinations generator lists them. More counting tools are on the statistics calculators page.
Factorial Calculator: FAQ
What is 10 factorial?
10! = 3,628,800. It is 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1.
Can you take the factorial of a negative number or a fraction?
Not with this definition, which needs a whole number of 0 or more. The gamma function extends the idea to fractions, but this calculator does not use it.
How many ways can 5 people stand in a line?
5! = 120. Five choices for the first place, four for the second, and so on: 5 × 4 × 3 × 2 × 1.
Sources
- Wikipedia: Factorial — definition, 0! = 1 and the growth of n! (checked October 16, 2026)
- MDN Web Docs: Number.MAX_VALUE — the largest number JavaScript can store, about 1.8 × 10³⁰⁸ (checked October 16, 2026)