Where Factorials Come From
A factorial answers an everyday counting question. Ask “in how many orders can 5 books sit on a shelf?” — the first slot has 5 choices, the next 4, then 3, 2, 1, and multiplying the choices gives 5! = 120. That is all a factorial is: a compact way to write the product of the counting choices. Factorials count permutations, and they explode fast: 10! is already 3.6 million, and 20! exceeds 2 quintillion. Type any whole number from 0 to 1000 above and this calculator returns the exact value, however many digits it has.
The Definition, Symbol by Symbol
The definition is n! = n × (n−1) × (n−2) × … × 2 × 1. Here n is a non-negative whole number — the starting point of the product and the count of objects being arranged. The exclamation mark ! is the factorial operator itself: it is not punctuation and not emphasis, it is an instruction to multiply every whole number from n down to 1. Each number in the chain is called a factor of the product. Because n! = n × (n−1)!, every factorial is built from the one before it — exactly the loop this tool runs, using exact BigInt arithmetic so no digit is ever rounded away.
The Two Facts That Confuse Everyone
- 0! = 1 by definition — an empty product equals 1, which keeps combination formulas working.
- Factorials only apply to whole numbers. For decimals, mathematicians extend the idea with the Gamma function, where n! = Γ(n+1).
How to Use This Factorial Expression Calculator
- Type a whole number into the single “Enter n (0 – 1000)” box. There is no button — the result updates as you type.
- Read the headline result n! = …, shown in full for shorter values and truncated with its true digit count for very large ones.
- Check the expansion line: for n up to 12 the tool writes out the complete product (for example 5! = 5 × 4 × 3 × 2 × 1 = 120) so you can verify each factor.
- Mind the limits: negatives and values over 1000 get an explanation instead of a number, and decimals get the Gamma-function note.
Worked Example 1: Computing 7! Step by Step
- Start at the top: 7 × 6 = 42.
- Bring in the 5: 42 × 5 = 210.
- Bring in the 4: 210 × 4 = 840.
- Bring in the 3: 840 × 3 = 2,520.
- Finish with 2 and 1: 2,520 × 2 = 5,040, and × 1 leaves it unchanged. So 7! = 5,040.
Notice how the running total jumps: adding one more factor does not add a fixed amount, it multiplies everything so far. That is why 7! is already in the thousands while 7 + 6 + 5 + 4 + 3 + 2 + 1 is just 28. In counting terms, 5,040 is the number of ways 7 runners can cross a finish line in some order, or the number of different seven-digit strings you can make from the digits 1 to 7 with no repeats.
Worked Example 2: Choosing a Committee of 3 From 10
- Use the combination formula: C(10, 3) = 10! ÷ (3! × 7!).
- Cancel before you multiply: 10! contains 7! as its tail (10 × 9 × 8 × 7!), so the 7! cancels top and bottom, leaving (10 × 9 × 8) ÷ 3!.
- Compute the pieces: 10 × 9 × 8 = 720, and 3! = 3 × 2 × 1 = 6.
- Divide: 720 ÷ 6 = 120 different committees.
The cancellation step is the professional shortcut: nobody evaluates 10! = 3,628,800 and 7! = 5,040 in full just to divide them. It also explains the division in the formula — the 720 ordered selections (permutations) count each committee 3! = 6 times, once for each internal ordering, and dividing by 6 removes exactly that overcount. Order stopped mattering, so each group is counted once.
Factorials in Probability
Combinations (nCr) and permutations (nPr) are built from factorials — lottery odds, poker hands, and committee selections all reduce to factorial division. Try the probability calculator to put them to work.
When Factorials Turn Up in Real Life
A shuffled deck of cards has 52! ≈ 8.07 × 10^67 possible orders — so many that every proper shuffle in history has almost certainly produced an arrangement never seen before. Lottery odds are factorial arithmetic: a 6-from-49 draw has C(49, 6) = 13,983,816 combinations. Computer scientists meet factorials when counting the possible orderings an algorithm might have to search, which is why brute-force methods die so quickly as n grows. Even the denominators in the Taylor series for e^x and sin x are factorials quietly doing the work.
Common Mistakes
- Adding the numbers instead of multiplying. 5! is 120, not 5 + 4 + 3 + 2 + 1 = 15. The exclamation mark means a product chain — every term multiplies.
- Writing 0! = 0. It is 1. Setting it to 0 silently breaks every combination formula that uses it, turning “choose none” into “impossible”.
- Using a permutation when order does not matter. Counting a committee with n! style reasoning overcounts by the internal orderings — divide by r! for combinations, or your “120 committees” becomes 720.