Factorial Calculator
Last updated:
How to Use This Calculator
Step 1: Enter a non-negative integer (0, 1, 2, ..., up to 1000).
Step 2: Click Calculate.
Step 3: See the factorial value, scientific notation, and step-by-step expansion. Very large factorials are computed with arbitrary-precision integers.
What Is a Factorial?
The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 up to n. For example, 5! = 1 × 2 × 3 × 4 × 5 = 120.
By definition, 0! = 1 and 1! = 1. This might seem odd, but it is the convention that makes the rules of combinatorics work consistently — it's the 'empty product' (a product with no factors is 1, just as an empty sum is 0).
Factorials grow extraordinarily fast. 10! is about 3.6 million. 20! is over 2 quintillion. 100! has 158 digits. By n = 170, factorials exceed what can be represented in standard floating-point numbers — this calculator uses JavaScript BigInt for exact results beyond that point.
The Factorial Formula
n! = 1 × 2 × 3 × ... × n
Recursive definition: n! = n × (n−1)!
Special cases: 0! = 1 and 1! = 1
Example: 5! = 5 × 4 × 3 × 2 × 1 = 120
Related formulas:
• Permutations: nPr = n! / (n−r)!
• Combinations: nCr = n! / (r! × (n−r)!)
Factorials for Small n
| n | n! | Value |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| 5 | 5! | 120 |
| 10 | 10! | 3,628,800 |
| 15 | 15! | 1,307,674,368,000 |
| 20 | 20! | 2.43 × 10¹⁸ |
| 100 | 100! | 158 digits |
Examples
Example 1: 5! = 1 × 2 × 3 × 4 × 5 = 120 — the number of ways to arrange 5 books on a shelf.
Example 2: 10! = 3,628,800 — possible orders for 10 runners in a race.
Example 3: 52! ≈ 8.07 × 10⁶⁷ — the number of possible orderings of a standard deck of cards (more than the number of atoms in the observable galaxy).
Tips
0! = 1 by convention — this makes combinatorics formulas work.
Factorials explode fast. 20! already exceeds 2 quintillion.
52! is astronomically large — a well-shuffled deck has never been in that exact order before.
Permutations and combinations both use factorials.
Frequently Asked Questions
Why does 0! equal 1?
What is the factorial of a negative number or fraction?
Why do factorials grow so quickly?
What are factorials used for in real life?
How large can factorials get before computers fail?
Is 52! really larger than the number of atoms in the galaxy?
Related Calculators
Prime Number Checker
Free prime number checker. Check if any number is prime with step...
Exponent Calculator
Free exponent calculator. Compute any base raised to any power wi...
Logarithm Calculator
Free logarithm calculator. Compute log base any value with step-b...
Random Number Generator
Free random number generator. Generate one or multiple random int...