← All tools/Calculators/Math/Factorial Calculator
Factorial Calculator
n! is the product of all whole numbers from 1 to n — with the exact value, step by step.
Enter a whole number from 0 to 170. Values above 170! are too large for a web page to show exactly.
5! equals
How it works
n! = 1 × 2 × 3 × … × n 0! = 1 (by definition — the empty product) 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120
Worked example: 5! = 1 × 2 × 3 × 4 × 5 = 120. Counting up: 0! = 1, 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, 7! = 5,040, 8! = 40,320, 9! = 3,62,880, 10! = 36,28,800. The values grow fast — 20! is already 2,43,29,02,00,81,76,64,00,000 (about 2.43 × 10¹⁸).
Frequently asked questions
What is a factorial?
The product of all whole numbers from 1 up to n. 5! means 1 × 2 × 3 × 4 × 5, which is 120.
Why is 0! equal to 1?
By definition: the product of no numbers (the empty product) is 1, the same way a sum of no numbers is 0. It also makes the formulas that use factorials — like permutations — work out correctly.
How large can the answer get?
Very fast. 20! is about 2.43 × 10¹⁸, 100! has 158 digits, and 170! has 307 digits. This tool shows exact values up to 170!; beyond that the numbers are too large for a web page to display exactly.
Where are factorials used?
Counting arrangements: the number of ways to order n different items is n!. They also appear in probability, combinations, and the series for eˣ, sin x and cos x.
What about negative numbers or decimals?
Factorials are only defined for whole numbers 0 and above. For decimals and negative numbers mathematicians use the gamma function, which this tool does not cover.
More tools
Tell us what you think
Loving this tool, or stuck on something? Tell us — it takes a minute.
We’ll only use your name and email to reply if needed. The tool and page are filled in for you.