Factorial Calculator
Calculate the factorial of a number (n!).
Calculator Inputs
Your Result
Enter your details and press Calculate to see your result.
Formula
How it works
- Enter a whole number.
- View its factorial (n!).
Share on Social Media:
The factorial of a whole number n, written n!, is the product of every whole number from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. Enter any whole number from 0 to 500 and this calculator returns the exact result, every digit included, using arbitrary-precision arithmetic, so large factorials don't lose accuracy.
Definition
n! = n × (n − 1) × (n − 2) × … × 2 × 1, and by definition 0! = 1.
0! = 1 because there is exactly one way to arrange zero objects: do nothing. It also keeps formulas like n! = n × (n − 1)! consistent when n = 1.
Examples
| n | n! |
|---|---|
| 0 | 1 |
| 5 | 120 |
| 10 | 3,628,800 |
| 13 | 6,227,020,800 |
| 20 | 2,432,902,008,176,640,000 |
Factorials grow faster than exponential functions. 52! (the number of ways to shuffle a deck of cards) has 68 digits, and 500! has 1,135 digits.
Where factorials are used
- Arrangements: 5 people can stand in a line in 5! = 120 different orders.
- Permutations and combinations: nPr = n! ÷ (n − r)! and nCr = n! ÷ (r! × (n − r)!). See the Permutation Calculator and Combination Calculator.
- Probability: the chance of a random shuffle putting 10 items in one exact order is 1 in 10! = 1 in 3,628,800.
- Calculus: Taylor series, such as eˣ = 1 + x + x²/2! + x³/3! + …
Why the limit is 500?
Results are calculated exactly, not rounded to floating-point numbers. A normal calculator switches to scientific notation after about 13! and can't show factorials above 170! at all. The 500 cap keeps the full result readable on the page. Factorials are only defined here for non-negative whole numbers; the gamma function extends the idea to fractions.