Permutation and Combination Calculator
Compute nPr and nCr exactly, with the formula steps
๐ Enter n and r
๐ Results
๐งฎ Step by step
โ๏ธ Order matters vs. order doesn't
Permutations are 3! = 6ร larger than combinations, because each group of 3 can be ordered in 3! ways.
๐ nPr and nCr for n = 10
| r | nPr | nCr |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 10 | 10 |
| 2 | 90 | 45 |
| 3 | 720 | 120 |
| 4 | 5,040 | 210 |
| 5 | 30,240 | 252 |
| 6 | 151,200 | 210 |
| 7 | 604,800 | 120 |
| 8 | 1,814,400 | 45 |
| 9 | 3,628,800 | 10 |
| 10 | 3,628,800 | 1 |
Results use exact integer arithmetic (BigInt). Permutations count ordered selections; combinations count unordered selections. For real-world probability, divide a favorable count by the total count.
Last updated June 2026
Method: Standard combinatorics. Permutations use nPr = n! / (n − r)!; combinations use nCr = n! / (r! × (n − r)!). All results use exact arbitrary-precision integer arithmetic (BigInt), so there is no rounding error.
Included: nPr, nCr, the worked formula steps, the difference between the two, and a reference table of nPr and nCr for every r at your chosen n.
Not included: Selections with repetition (n^r and (n + r − 1)C r), circular permutations, and arrangements with identical/repeated items, which use different formulas.
Permutations and combinations: everything you need to know
Suppose 8 sprinters line up for a race and you want to know how many ways the medals could be handed out for 1st, 2nd, and 3rd place. Because finishing order matters, that is a permutation: 8P3 = 336. Now suppose instead you just want to pick 3 of those 8 runners for a relay team, where it does not matter who you name first. That is a combination: 8C3 = 56. Same 8 people, same 3 chosen, but six times as many permutations as combinations - because each team of 3 can be ordered in 3! = 6 ways. That single idea, "does order matter?", is the whole game, and this permutation and combination calculator answers both at once so you can see the gap instantly.
The formulas
Both formulas are built from the factorial, written n!, which is the product of every whole number from 1 up to n (and 0! is defined as 1). The permutation and combination formulas are:
nPr = n! ÷ (n − r)! nCr = n! ÷ ( r! × (n − r)! ) Here n is the total number of distinct items and r is how many you select. The only difference between the two is the extra r! in the denominator of the combination formula. That r! removes the duplicate orderings, which is why the two are linked by the tidy relationship nCr = nPr ÷ r!.
How to use this calculator
You only need two numbers:
- Enter n - the total number of distinct items you are choosing from (for example, 52 cards or 10 books).
- Enter r - how many items you are selecting or arranging (for example, 5 cards or 3 books). r must be less than or equal to n.
- Read both results. The blue card shows permutations (order matters); the cyan card shows combinations (order does not matter). They update instantly as you type.
- Check the steps. The step-by-step panel substitutes your numbers into each formula, and the reference table lists nPr and nCr for every r at your chosen n.
If you enter a value of r larger than n, or a non-whole number, the calculator explains what to fix instead of showing a wrong answer.
Permutation vs. combination: which one do I need?
Ask yourself a single question: if I shuffle the chosen items, is it a different outcome?
- If yes, use permutations (nPr). Race finishes, passwords and PINs, seating in a row, ranking, assigning specific roles (president vs. treasurer) - order changes the result.
- If no, use combinations (nCr). Lottery numbers, a hand of cards, a committee, a pizza's toppings, choosing a subset - shuffling the picks gives the same group.
Worked example 1 - a deck of cards
How many different 5-card poker hands come from a standard 52-card deck? The order you are dealt the cards does not matter, so this is a combination: 52C5 = 52! ÷ (5! × 47!) = 2,598,960. If order did matter (say you were dealt the cards into 5 labeled slots), it would be the permutation 52P5 = 311,875,200 - exactly 5! = 120 times larger.
Worked example 2 - a lottery
A "6 from 49" lottery draws 6 numbers from 49, and order does not matter, so the number of possible tickets is 49C6 = 13,983,816. That is why the odds of matching all six on one ticket are about 1 in 14 million. The permutation 49P6 is far larger (about 10 billion) because it would treat every drawn order as distinct - which a real lottery does not.
Worked example 3 - arranging vs. choosing books
You have 10 books and a shelf that holds 3. How many ways can you arrange 3 on the shelf? Order matters (left-to-right), so 10P3 = 10 × 9 × 8 = 720. How many distinct sets of 3 books could you pick to take on a trip? Order is irrelevant, so 10C3 = 720 ÷ 3! = 120. The 720 arrangements collapse into 120 sets because each set of 3 can be lined up in 3! = 6 ways.
Key terms
- Factorial (n!): the product of all whole numbers from 1 to n. 5! = 5 × 4 × 3 × 2 × 1 = 120. By convention 0! = 1.
- n: the size of the full set you are choosing from.
- r: the number of items you select or arrange, with 0 ≤ r ≤ n.
- Permutation (nPr): an ordered arrangement of r items from n.
- Combination (nCr): an unordered selection of r items from n; also called the "binomial coefficient" and written as (n choose r).
- Without replacement: each item is used at most once - the assumption behind both formulas on this page.
Quick reference table
A few common values, so you can sanity-check the calculator at a glance:
| n, r | nPr | nCr | Typical use |
|---|---|---|---|
| 5, 2 | 20 | 10 | Pairs from 5 |
| 6, 3 | 120 | 20 | Teams of 3 |
| 8, 3 | 336 | 56 | Medal finishes |
| 10, 3 | 720 | 120 | Shelving books |
| 49, 6 | 10,068,347,520 | 13,983,816 | 6/49 lottery |
| 52, 5 | 311,875,200 | 2,598,960 | Poker hands |
Useful tips and shortcuts
- Symmetry of combinations: nCr = nC(n − r). Choosing 47 cards to leave behind is the same as choosing 5 to keep, so 52C47 = 52C5. Use the smaller r for quicker mental math.
- Edge cases are easy: nC0 = nCn = 1 (one way to choose nothing or everything), nC1 = n, and nP1 = n.
- Don't compute giant factorials directly: nPr is just the product of r descending terms (n × (n−1) × ...), so you rarely need the full n!. This calculator uses that shortcut internally.
- For probability, the count from this tool is usually the denominator: divide favorable outcomes by total outcomes (often an nCr) to get the odds.
Common pitfalls
- Using the wrong tool: the single most common error is treating an ordered problem as unordered (or vice versa). Always check whether rearranging the picks creates a new outcome.
- Assuming repetition: these formulas are "without replacement." If items can repeat (digits in a PIN, scoops on a cone with repeats allowed), you need n^r or the repetition combination formula instead.
- Forgetting identical items: arranging the letters of "LEVEL" is not 5! because letters repeat; you divide by the factorials of the repeats. That is a different (multiset) formula.
- Mixing up n and r: n is the pool, r is the pick. Swapping them changes the answer and can make r > n, which is invalid.
Related concepts
Permutations and combinations are the foundation of counting and probability. The combination nCr is also the binomial coefficient that appears in Pascal's triangle and the binomial theorem (the coefficients when you expand (a + b)^n). Closely related ideas include selections with repetition (n^r for ordered, (n + r − 1)C r for unordered) and circular permutations, where arranging r distinct items in a ring gives (r − 1)! because rotations are considered the same. Once you are comfortable with nPr and nCr, those variations follow naturally.
How it compares to related calculators
This page answers "how many ways can I arrange or choose r items from n?" For a different question, a sister tool fits better:
- To work with percentages and odds, use the Percentage Calculator.
- To add, reduce, and compare fractions (like simplifying a probability), use the Fraction Calculator.
- For factorials, powers, and general expressions, use the Scientific Calculator.
- To raise numbers to a power (the n^r in repetition problems), use the Exponent Calculator.
- For means and basic statistics, use the Average Calculator.
โ ๏ธ Common mistakes & edge cases
Picking permutation when order doesn't matter
A committee of 3 from 10 people is 10C3 = 120, not 10P3 = 720. If the roles are identical, you are double-counting every group 3! = 6 times. Only use nPr when rearranging the picks is a genuinely different outcome.
Setting r greater than n
You can't choose 7 items from a set of 5. If r > n, the count is zero. Double-check that n is the full pool and r is the smaller number of items you actually select.
Allowing repetition by accident
nPr and nCr assume each item is used once (without replacement). A 4-digit PIN that allows repeats has 10^4 = 10,000 options, not 10P4. Match the formula to whether items can repeat.
Trusting decimal answers for big inputs
Factorials overflow ordinary calculators fast (13! already exceeds a billion). Rounded or "scientific notation only" answers can be wrong in the last digits. This tool uses exact integer math so the full value stays correct.
❓ Frequently asked questions
What is the difference between a permutation and a combination?
A permutation is an arrangement where order matters, so ABC and CBA count as two different outcomes. A combination is a selection where order does not matter, so ABC and CBA are the same group. Because of this, nPr (permutations) is always greater than or equal to nCr (combinations) for the same n and r.
What do nPr and nCr mean?
nPr is the number of ways to arrange r items chosen from a set of n distinct items, calculated as n! / (n - r)!. nCr is the number of ways to choose r items from n when order is ignored, calculated as n! / (r! x (n - r)!). The 'P' stands for permutation and the 'C' for combination.
How are nPr and nCr related?
They differ only by the factor r!. Specifically, nCr = nPr / r!. Each unordered combination of r items can be arranged in r! different orders, so dividing the number of permutations by r! removes those duplicate orderings and gives the number of combinations.
What is the formula for permutations?
The permutation formula is nPr = n! / (n - r)!, where n! (n factorial) is the product of all whole numbers from 1 up to n. For example, 10P3 = 10! / 7! = 10 x 9 x 8 = 720. It counts ordered selections of r items from n.
What is the formula for combinations?
The combination formula is nCr = n! / (r! x (n - r)!). For example, 10C3 = 10! / (3! x 7!) = 720 / 6 = 120. This counts how many distinct groups of r items can be formed from n, ignoring the order within each group.
What does 0! (zero factorial) equal?
Zero factorial is defined to equal 1. This convention makes the formulas work cleanly: for instance, nC0 = n! / (0! x n!) = 1, which correctly says there is exactly one way to choose nothing, and nCn = 1, one way to choose everything.
Can r be larger than n?
No. You cannot choose or arrange more items than you have, so r must be less than or equal to n. If r is greater than n, both nPr and nCr are zero (or undefined in everyday use), and this calculator will ask you to lower r.
Does this calculator allow repetition?
No. Both formulas here assume distinct items selected without replacement, so each item can be used at most once. Problems that allow repetition (such as a PIN where digits can repeat) use different formulas: n^r for ordered selections and (n + r - 1)C r for unordered selections with repetition.
Why does the calculator use exact integers for big numbers?
Factorials grow extremely fast, so results quickly exceed what ordinary decimal arithmetic can store accurately. This tool uses arbitrary-precision integer math (BigInt), so the displayed value is exact even when it has dozens of digits. Very large numbers are also shown in a compact scientific form for readability.
What is a real example of when to use each?
Use permutations for ordered outcomes: the number of ways 3 runners can finish 1st, 2nd, 3rd out of 8 is 8P3 = 336. Use combinations for unordered outcomes: the number of 5-card poker hands from a 52-card deck is 52C5 = 2,598,960, because the order you are dealt the cards does not change the hand.
๐ก Good to know
One question decides everything: does order matter?
If shuffling the chosen items makes a new outcome (a race finish, a password), use permutations. If it's the same group either way (a lottery ticket, a card hand), use combinations. Get this right and the formula follows automatically.
Permutations are always r! times the combinations
For the same n and r, nPr = nCr x r!. So 10P3 (720) is exactly 3! = 6 times 10C3 (120). The difference card on this page shows that extra count of orderings directly.
nCr is the same forwards and backwards
Because nCr = nC(n - r), choosing what to keep is the same as choosing what to leave out. 52C5 = 52C47. Use the smaller r and the math gets a lot easier.
Related Calculators
Percentage Calculator
Solve any percentage problem - what is X% of Y and more
Fraction Calculator
Add, subtract, multiply and divide fractions
Scientific Calculator
A full scientific calculator with trig, logs and more
Average Calculator
Calculate the mean, median and mode of numbers
Square Root Calculator
Find the square root of any number
Exponent Calculator
Raise numbers to any power