By Tim King · Updated
Permutation and Combination Calculator
nPr and nCr, With and Without Repetition
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Permutation and Combination Calculator works
This permutation and combination calculator counts the ways to choose r items from n. Combinations (nCr) ignore order, as in a lottery draw; permutations (nPr) count each order separately, as in first, second and third place. It also gives both counts with repetition allowed, and works exactly for n and r up to 10,000.
The one question to ask is: does order matter? Picking 3 pizza toppings from 10 is a combination, because pepperoni-ham-olive is the same pizza as olive-ham-pepperoni. Awarding gold, silver and bronze to 3 of 10 runners is a permutation, because the order changes the result. Repetition is the second question: a PIN can reuse digits, but a team cannot pick the same person twice.
How the permutation and combination calculator works
The formula for permutations is nPr = n! / (n − r)!, and for combinations nCr = n! / (r! × (n − r)!). Each combination can be ordered in r! ways, which links the two: nPr = nCr × r!. With repetition, permutations are n^r and combinations are (n + r − 1)Cr. Big integers keep every digit.
First example. 49C6 = 13,983,816, the number of possible 6-number lottery tickets from 49 balls.
Second example. 10P3 = 10 × 9 × 8 = 720 ways to award gold, silver and bronze among 10 runners.
How many 4-digit PINs are there? Digits can repeat and order matters, so 10^4 = 10,000.
Combinations and permutations for n from 6 to 30
| n | nC2 | nC3 | nC5 | nC6 | nP3 |
|---|---|---|---|---|---|
| 6 | 15 | 20 | 6 | 1 | 120 |
| 7 | 21 | 35 | 21 | 7 | 210 |
| 8 | 28 | 56 | 56 | 28 | 336 |
| 9 | 36 | 84 | 126 | 84 | 504 |
| 10 | 45 | 120 | 252 | 210 | 720 |
| 11 | 55 | 165 | 462 | 462 | 990 |
| 12 | 66 | 220 | 792 | 924 | 1,320 |
| 13 | 78 | 286 | 1,287 | 1,716 | 1,716 |
| 14 | 91 | 364 | 2,002 | 3,003 | 2,184 |
| 15 | 105 | 455 | 3,003 | 5,005 | 2,730 |
| 16 | 120 | 560 | 4,368 | 8,008 | 3,360 |
| 17 | 136 | 680 | 6,188 | 12,376 | 4,080 |
| 18 | 153 | 816 | 8,568 | 18,564 | 4,896 |
| 19 | 171 | 969 | 11,628 | 27,132 | 5,814 |
| 20 | 190 | 1,140 | 15,504 | 38,760 | 6,840 |
| 21 | 210 | 1,330 | 20,349 | 54,264 | 7,980 |
| 22 | 231 | 1,540 | 26,334 | 74,613 | 9,240 |
| 23 | 253 | 1,771 | 33,649 | 100,947 | 10,626 |
| 24 | 276 | 2,024 | 42,504 | 134,596 | 12,144 |
| 25 | 300 | 2,300 | 53,130 | 177,100 | 13,800 |
| 26 | 325 | 2,600 | 65,780 | 230,230 | 15,600 |
| 27 | 351 | 2,925 | 80,730 | 296,010 | 17,550 |
| 28 | 378 | 3,276 | 98,280 | 376,740 | 19,656 |
| 29 | 406 | 3,654 | 118,755 | 475,020 | 21,924 |
| 30 | 435 | 4,060 | 142,506 | 593,775 | 24,360 |
Tips and pitfalls
- Order matters means permutation. Rankings, passwords and seat plans are permutations.
- Order does not matter means combination. Hands of cards, committees and lottery picks are combinations.
- Combination locks are misnamed. Order matters on a lock, so it is really a permutation lock.
- r cannot exceed n without repetition. You cannot pick 7 different items from 5.
FAQ
What is the difference between a permutation and a combination?
A permutation counts arrangements where order matters; a combination counts selections where it does not. Choosing 2 of A, B, C gives 3 combinations (AB, AC, BC) but 6 permutations (AB, BA, AC, CA, BC, CB). Permutations are always at least as many as combinations.
How do you calculate combinations?
Use nCr = n! ÷ (r! × (n − r)!). For 5C2, that is 120 ÷ (2 × 6) = 10. In practice it is quicker to multiply r falling terms and divide by r!: 5 × 4 ÷ (2 × 1) = 10. The calculator does this exactly even when the answer has thousands of digits.
How many combinations of 6 numbers from 49 are there?
There are 13,983,816 ways to choose 6 numbers from 49, so a single ticket has a 1 in 13,983,816 chance of matching all six. If the order of the draw mattered, there would be 10,068,347,520 permutations, which is 720 times as many.
What does with repetition mean?
It means an item can be chosen more than once. A 3-letter code from 26 letters with repetition has 26^3 = 17,576 permutations. Choosing 3 scoops from 5 flavours, where two scoops can be the same, has 7C3 = 35 combinations with repetition.
How many ways can you arrange a deck of cards?
52! ≈ 8.07 × 10^67, a number so large that every properly shuffled deck is almost certainly in an order that has never existed before. Enter n = 52 and r = 52 to see it, or use the factorial calculator for the full 68 digits.
See also: all Statistics tools, Arithmetic, Number Theory, Algebra and Geometry, Trigonometry and Calculus.
Related tools
Factorial Calculator
Exact n factorial up to 5000!, with digits and trailing zeros.
Probability Calculator
Combine two probabilities, and the odds of at least once.
Loot Drop Calculator
Your real odds of a rare drop, and how many tries you need.
Dice Roller
Roll D6, D20 or any custom die with a fair random generator.
Binomial Probability Calculator
Exactly, at most and at least k successes in n trials.