Factorial Calculator

Max value: 170 (JavaScript limit)

Factorial Reference Table

nn!
01
11
22
36
424
5120
6720
75040
840320
9362880
103628800
1139916800
12479001600

The Notation

n!
Factorial of n
P(n,r)
Permutations (order matters)
C(n,r)
Combinations (order doesn't matter)

Understanding Factorials

What is a Factorial?

A factorial (denoted as n!) is the product of all positive integers less than or equal to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorials grow extremely fast and are fundamental in combinatorics, probability, and calculus.

Factorial Definition

n! = n × (n-1) × (n-2) × ... × 2 × 1

Special cases:

0! = 1 (by definition)

1! = 1

Permutations

A permutation is an arrangement of objects where order matters. P(n,r) calculates how many ways to arrange r items from a set of n items.

P(n,r) = n! / (n-r)!

Example: How many ways can 3 people win gold, silver, and bronze from 8 contestants?

P(8,3) = 8! / 5! = 8 × 7 × 6 = 336 ways

Combinations

A combination is a selection of objects where order doesn't matter. C(n,r) calculates how many ways to choose r items from a set of n items.

C(n,r) = n! / (r! × (n-r)!)

Example: How many ways can you choose 3 people from a group of 8 for a committee?

C(8,3) = 8! / (3! × 5!) = 56 ways

Permutations vs Combinations

ScenarioOrder Matters?Use
Arranging books on a shelfYesPermutation
Choosing team membersNoCombination
Race finishing positionsYesPermutation
Selecting lottery numbersNoCombination
Creating a passwordYesPermutation

How Fast Do Factorials Grow?

nn!Digits
51203
103,628,8007
202.43 × 10¹⁸19
503.04 × 10⁶⁴65
1009.33 × 10¹⁵⁷158

Real-World Applications

  • Probability: Calculating odds in card games, dice, lotteries
  • Cryptography: Key space calculations for encryption
  • Statistics: Binomial coefficients, distributions
  • Computer Science: Algorithm complexity analysis
  • Physics: Quantum mechanics, statistical mechanics

Frequently Asked Questions

What is 0! (zero factorial) and why does it equal 1?

By mathematical convention, 0! = 1. This isn't arbitrary - it's necessary for many formulas to work correctly. For example, the combination formula C(n,n) = n!/(n!*0!) should equal 1 (there's exactly one way to choose all items), which only works if 0! = 1.

What's the difference between permutations and combinations?

Permutations count arrangements where order matters (like race positions: 1st, 2nd, 3rd are different from 3rd, 2nd, 1st). Combinations count selections where order doesn't matter (like choosing team members: {A,B,C} is the same as {C,B,A}). Permutations are always larger or equal to combinations.

Why do factorials grow so fast?

Factorials grow faster than exponential functions because each term adds another multiplication. 10! is about 3.6 million, 20! exceeds 2 quintillion, and 100! has 158 digits. This rapid growth is why factorials quickly exceed calculator limits.

How are factorials used in probability?

Factorials are fundamental to probability calculations. They're used to count possible arrangements (permutations) and selections (combinations). For example, calculating lottery odds, card hand probabilities, or the number of ways to arrange items all require factorials.