Factorial Calculator

Calculate factorials (n!), permutations P(n,r), and combinations C(n,r). Free online factorial calculator with step-by-step formulas.

=
1

Factorial Table (1-20)

1!1
2!2
3!6
4!24
5!120
6!720
7!5,040
8!40,320
9!362,880
10!3,628,800
11!39,916,800
12!479,001,600
13!6,227,020,800
14!87,178,291,200
15!1,307,674,368,000
16!20,922,789,888,000
17!355,687,428,096,000
18!6,402,373,705,728,000
19!121,645,100,408,832,000
20!2,432,902,008,176,640,000

Formulas

n! = n × (n-1) × (n-2) × ... × 2 × 1
P(n,r) = n! / (n-r)!
C(n,r) = n! / (r! × (n-r)!)

🔒 Fast, free math calculators that run in your browser. No uploads, 100% private.

Last updated: January 2026

Related Calculators

Frequently Asked Questions

What is a factorial and how do I calculate it?
A factorial (written as n!) is the product of all positive integers from 1 to n. For example: 5! = 5 × 4 × 3 × 2 × 1 = 120. The definition is recursive: n! = n × (n-1)!. Factorials grow extremely fast: 10! = 3,628,800 and 20! = 2,432,902,008,176,640,000. They're fundamental in combinatorics, probability, and algebra. Common values to memorize: 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, 7! = 5,040.
Why does 0! (zero factorial) equal 1?
Zero factorial equals 1 by definition, and there are good mathematical reasons: First, it makes the recursive formula work: n! = n × (n-1)!, so 1! = 1 × 0!, meaning 0! must equal 1. Second, it represents 'how many ways to arrange zero objects'—there's exactly one way: do nothing. Third, it keeps the combination formula valid: C(n,n) = n!/(n!×0!) = 1, which makes sense (one way to choose all items). This convention is used universally in mathematics and programming.
What's the difference between permutations and combinations?
The key difference is whether order matters. Permutations P(n,r) count arrangements where order matters: selecting 3 books from 5 and arranging them on a shelf. Formula: P(n,r) = n!/(n-r)!. Example: P(5,3) = 5!/2! = 60 ways. Combinations C(n,r) count selections where order doesn't matter: choosing 3 people from 5 for a committee. Formula: C(n,r) = n!/[r!(n-r)!]. Example: C(5,3) = 5!/(3!×2!) = 10 ways. Remember: permutations are always larger because each combination can be arranged in r! ways.
Where are factorials used in real life?
Factorials appear in many practical applications: Probability calculations (lottery odds, card games—chance of poker hand), scheduling and arrangements (seating charts, tour routing—the traveling salesman problem involves (n-1)!/2 routes), computer science (algorithm complexity, sorting permutations), statistics (binomial distribution, statistical tests), cryptography (key space calculations), and DNA sequencing (possible arrangements of base pairs). Even simple questions like 'how many ways can 8 people stand in line?' use factorials: 8! = 40,320 arrangements.
How fast do factorials grow and what's the largest my calculator can handle?
Factorials grow faster than exponential functions—this is called 'super-exponential' growth. Comparison: 10! ≈ 3.6 million, 15! ≈ 1.3 trillion, 20! ≈ 2.4 quintillion, 100! has 158 digits. Most standard calculators overflow around 170! (which has 307 digits). For very large factorials, use Stirling's approximation: n! ≈ √(2πn) × (n/e)^n. This approximation is accurate to within 1% for n > 10. Programming languages with arbitrary precision (Python, JavaScript BigInt) can calculate much larger factorials, limited only by memory.