Factorial Calculator — n!, Permutations & Combinations
Compute any factorial n!, factorial expressions like 6!/(6−3)! = 120, permutations 10P3 = 720, and combinations 10C3 = 120 — every answer with the exact steps. 5! = 5 × 4 × 3 × 2 × 1 = 120, and 0! = 1 by definition. And 52! ≈ 8.066 × 1067 — a 68-digit number so large that every shuffle of a deck of cards is almost certainly a permutation never seen before in history.
Factorial Calculator: n!, Expressions, Permutations & Combinations
Pick the mode that matches what you need. Calculations run in your browser.
What Is a Factorial Calculator?
A factorial calculator works with n! (read "n factorial") — the product of every positive whole number up to n. This free tool handles four jobs: factorial n! (5! = 120), factorial expressions like n!/(n−k)! (6!/(6−3)! = 120), permutations nPr for ordered arrangements (10P3 = 720), and combinations nCr for unordered selections (10C3 = 120). Every answer comes with the exact steps so you can verify it by hand.
How to Use the Factorial Calculator
The tool has four modes so you can start with whatever you need to find.
- Choose a mode that matches your problem (or tap a preset to load a worked example).
- Enter whole numbers — n from 0 to 170, and r (or k) no bigger than n.
- Select Calculate to generate the result cards.
- Read the note under the cards for the step-by-step working and a check you can verify by hand.
The built-in check re-derives the answer a second way — n! = n × (n−1)! for factorials, and nCr = nPr / r! for combinations — so a wrong keystroke shows up immediately.
What Is a Factorial?
A factorial counts arrangements. The factorial of n, written n!, is the product of every positive whole number up to n: n! = n × (n−1) × … × 2 × 1. It answers the question "in how many orders can n different things be arranged?" — 5 books on a shelf can be ordered in 5! = 120 ways, because there are 5 choices for the first spot, 4 for the second, 3 for the third, 2 for the fourth, and 1 for the last.
Factorials grow shockingly fast. 10! is already 3,628,800, 20! is about 2.43 × 1018, and 52! is about 8.066 × 1067 — a 68-digit number. The table below shows the first eleven values exactly.
| n | n! (exact) | What it counts |
|---|---|---|
| 0 | 1 | Arranging zero objects — exactly 1 way (do nothing) |
| 1 | 1 | One object, one order |
| 2 | 2 | AB, BA |
| 3 | 6 | Orders of 3 books on a shelf |
| 4 | 24 | Orders of 4 runners finishing a race |
| 5 | 120 | Orders of 5 books; 5 × 4 × 3 × 2 × 1 |
| 6 | 720 | Orders of 6 songs in a playlist |
| 7 | 5,040 | Orders of 7 letters |
| 8 | 40,320 | Orders of 8 players in a line |
| 9 | 362,880 | Orders of 9 digits |
| 10 | 3,628,800 | Orders of 10 books |
Why 0! = 1 (and Why It Is Not 0)
Zero factorial looks like it should be 0 — but it is 1, by definition, and the definition is not arbitrary. First, 0! is the empty product: the product of no numbers at all, and the empty product is 1, just as the empty sum is 0. Second, the recurrence n! = n × (n−1)! forces it: 1! = 1 × 0! only works if 0! = 1. Third, it keeps the counting formulas working: there is exactly 1 way to choose 0 items from n (choose nothing), so nC0 = n!/(0! × n!) = 1 only if 0! = 1. The calculator's 0! preset shows this directly.
How Big Is 52! Really?
52! ≈ 8.066 × 1067 — a 68-digit number. It is often compared with the roughly 1080 atoms in the observable universe, but get the direction right: 52! is smaller than the atom count (52!/1080 ≈ 8 × 10−13). The honest shock is time: there have been only about 4.35 × 1017 seconds since the Big Bang, so 52! is about 1.85 × 1050 times the age of the universe in seconds. That is why every shuffle of a 52-card deck is almost certainly a permutation no one has ever seen before in history — there are 52! possible orders, and humanity has shuffled only a tiny fraction of them.
Factorial Calculator Worked Examples
Every row below is computed exactly — hand-verified in Python — so you can check each one by hand.
| Task | Working | Answer |
|---|---|---|
| 5! | 5 × 4 × 3 × 2 × 1 | 120 |
| 0! | Empty product, by definition | 1 |
| 6!/(6−3)! | 6 × 5 × 4 (the 3! cancels) | 120 |
| 10P3 | 10 × 9 × 8 | 720 |
| 10C3 | 10P3 / 3! = 720 / 6 | 120 |
| 52P5 | 52 × 51 × 50 × 49 × 48 | 311,875,200 |
| 52C5 | 52P5 / 5! = 311,875,200 / 120 | 2,598,960 |
| 20! | 20 × 19 × … × 1 | ≈ 2.43 × 1018 |
| 52! | 52 × 51 × … × 1 (68 digits) | ≈ 8.066 × 1067 |
The 52-Card Deck: 52P5 and 52C5
Deal 5 cards from a 52-card deck. If the order matters (a 5-card sequence), there are 52P5 = 52 × 51 × 50 × 49 × 48 = 311,875,200 ways. If the order does not matter (a poker hand), divide by the 5! = 120 orders of the same 5 cards: 52C5 = 311,875,200 / 120 = 2,598,960 possible 5-card hands. That single division by r! is the whole difference between permutations and combinations — and it is why 10P3 = 720 is exactly 6 times 10C3 = 120 (because 3! = 6).
The n!/(n−k)! Shortcut
You never need to compute two giant factorials to evaluate n!/(n−k)!. The bottom factorial cancels almost everything: 6!/(6−3)! = (6 × 5 × 4 × 3 × 2 × 1)/(3 × 2 × 1) = 6 × 5 × 4 = 120. Only the first k factors survive. The Expression mode shows this cancellation step by step — and it is also the permutation formula, since nPk = n!/(n−k)!.
How to Calculate a Factorial Step by Step
Follow this recipe for the classic example — calculating 5!.
- Write the countdown: start at 5 and count down to 1: 5, 4, 3, 2, 1.
- Multiply the first two: 5 × 4 = 20.
- Multiply by the next: 20 × 3 = 60.
- Keep going: 60 × 2 = 120.
- Finish: 120 × 1 = 120. So 5! = 120.
Common Mistakes With Factorials
1. Saying 0! = 0
The most common factorial mistake: 0! is 1, not 0. It is the empty product, and the recurrence 1! = 1 × 0! forces it. If 0! were 0, every combination formula with r = 0 or r = n would divide by zero.
2. Claiming 52! beats the atom count
52! ≈ 8.066 × 1067 is enormous — but the observable universe holds roughly 1080 atoms, so 52! is about 8 × 10−13 of that: smaller, not bigger. Use the honest comparison instead: 52! is about 1.85 × 1050 times the seconds since the Big Bang.
3. Mixing up nPr and nCr
Permutations (nPr) count orders; combinations (nCr) count sets. Arranging 3 books on a shelf is 10P3 = 720; choosing 3 books to take home is 10C3 = 120. Ask one question before you compute: "does the order matter?" If yes, nPr; if no, nCr.
4. Writing n! as n × (n−1) and stopping
n! is the product all the way down to 1, not just the first two factors. 5! is 5 × 4 × 3 × 2 × 1 = 120 — not 5 × 4 = 20. The countdown must reach 1 (or 0! = 1).
5. Expanding both factorials in n!/(n−k)!
Computing 52! and 47! separately to find 52P5 wastes effort and overflows most calculators. Cancel first: 52!/(52−5)! = 52 × 51 × 50 × 49 × 48 = 311,875,200. Only k factors survive.
6. Forgetting to divide by r! for combinations
10C3 is not 10 × 9 × 8 = 720 — that is 10P3. Combinations divide out the r! orders of the chosen items: 720/6 = 120. Forgetting the division overcounts by exactly r!.
Benefits and Limitations
Benefits
- Checks homework instantly: 5!, 0!, 10P3, 10C3 and 52! with every step shown.
- The 0! = 1 proof (empty product + recurrence + nC0 = 1) ends the most common confusion.
- The 52! scale section uses the correct comparison — smaller than ~1080 atoms, vastly larger than the seconds since the Big Bang.
- Permutation vs combination is taught by the 6× gap (720 vs 120), not just stated.
- Plain-ASCII math notation renders cleanly in every browser and font.
- Responsive on phones, tablets and desktops.
Limitations
- Whole numbers only — factorials of fractions or negatives are not defined here (the gamma function extends them, but this tool does not).
- n is capped at 170 because 171! exceeds what JavaScript numbers can represent for the scientific-notation display; exact BigInt values are shown up to that cap.
- Very large exact values (like the 68 digits of 52!) are shown in full plus scientific notation for readability.
Quick Definitions
| Question | Direct Answer |
|---|---|
| What is a factorial? | The product of every positive whole number up to n, written n!. 5! = 5 × 4 × 3 × 2 × 1 = 120; it counts the ways to arrange n different things in order. |
| What is 0!? | 1, by definition. It is the empty product, and the recurrence 1! = 1 × 0! forces it. There is exactly one way to arrange zero objects. |
| What is a permutation (nPr)? | An ordered arrangement of r items chosen from n: nPr = n!/(n−r)!. 10P3 = 10 × 9 × 8 = 720. |
| What is a combination (nCr)? | An unordered selection of r items from n: nCr = n!/(r!(n−r)!) = nPr/r!. 10C3 = 720/6 = 120. |
| How are nPr and nCr related? | nCr = nPr / r!. The r! divides out the orders of the chosen items. 10P3 = 720 and 10C3 = 120 differ by 3! = 6. |
| What is n!/(n−k)!? | The product of the k numbers from n down to n−k+1. 6!/(6−3)! = 6 × 5 × 4 = 120. It is also the permutation formula nPk. |
| How big is 52!? | About 8.066 × 10^67 — a 68-digit number. Smaller than the roughly 10^80 atoms in the observable universe, but about 1.85 × 10^50 times the seconds since the Big Bang. |
| What is 20!? | About 2.43 × 10^18 (exactly 2,432,902,008,176,640,000). It is the number of ways to arrange 20 different things in order. |
Frequently Asked Questions
What is 5 factorial?
5! = 120. Multiply every positive whole number up to 5: 5 × 4 × 3 × 2 × 1 = 120.
Why is 0! equal to 1?
0! = 1 by definition. It is the empty product — the product of no numbers at all — and it makes the permutation and combination formulas work when r = 0 or r = n. There is exactly one way to arrange zero objects: do nothing. The recurrence proves it too: 1! = 1 × 0! only works if 0! = 1.
What is 10P3?
10P3 = 720. Permutations count ordered arrangements: 10P3 = 10 × 9 × 8 = 720, or 10!/(10−3)! = 3,628,800/5,040 = 720.
What is 10C3?
10C3 = 120. Combinations count unordered selections: 10C3 = 10P3/3! = 720/6 = 120. Order does not matter, so 10C3 is 6 times smaller than 10P3.
How big is 52 factorial?
52! ≈ 8.066 × 1067 — a 68-digit number. It is still smaller than the roughly 1080 atoms in the observable universe, but it is about 1.85 × 1050 times the roughly 4.35 × 1017 seconds since the Big Bang — so every shuffle of a 52-card deck is almost certainly a permutation never seen before in history.
What is n! divided by (n−k)!?
The product of the k numbers from n down to n−k+1. The bottom factorial cancels everything except the first k factors: 6!/(6−3)! = 6 × 5 × 4 = 120. It is also the permutation formula nPk.
Related Math Tools
Factorial Calculator Methodology
This calculator derives every answer from the three standard counting formulas, using exact BigInt integer arithmetic (no floating-point rounding on the exact values shown).
Exact values are computed with BigInt multiplication from 1 to n, so 52! is produced digit-for-digit (80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000). Scientific notation is derived from the same exact value. The 52! scale comparison uses the commonly cited estimates of ~1080 atoms in the observable universe and ~4.35 × 1017 seconds since the Big Bang (13.8 billion years); the ratio 52!/1080 ≈ 8 × 10−13 and 52!/(4.35 × 1017) ≈ 1.85 × 1050 are computed from those estimates, which are approximate. Inputs are restricted to whole numbers with 0 ≤ n ≤ 170 and 0 ≤ r, k ≤ n; anything else is rejected before any calculation. The page is intended as an educational calculator and verification tool.
Mathematical References
Count It, Don't Guess It
Enter a number above — find its factorial, a factorial expression, the permutations or the combinations, with the exact steps shown.
Use Factorial Calculator