Permutation and Combination Calculator
Count how many ways you can arrange or choose r items from n. Get nPr, nCr and both counts with repetition at once, as exact whole numbers even when they have thousands of digits.
Whole number up to 100,000
How to use the Permutation and Combination Calculator
- Choose whether order matters: combinations if it does not, permutations if it does.
- Enter n, the number of items to choose from, and r, how many you pick.
- Tick "Items can repeat" if the same item may be chosen more than once.
- Press Calculate to see the count, all four variants, the steps and a table.
The four counting formulas
| Order matters | Order does not matter | |
|---|---|---|
| No repetition | nPr = n! ÷ (n − r)! | nCr = n! ÷ (r! (n − r)!) |
| With repetition | nr | C(n + r − 1, r) = (n + r − 1)! ÷ (r! (n − 1)!) |
A quick way to decide: if swapping two chosen items gives a different outcome (a different PIN, a different race result), order matters. If you only care which items end up in the group (a hand of cards, a committee, a pizza's toppings), it does not.
Reference values
| Situation | Type | Calculation | Result |
|---|---|---|---|
| Top 3 finishers out of 10 runners | nPr | 10 × 9 × 8 | 720 |
| Committee of 3 from 10 people | nCr | 720 ÷ 3! | 120 |
| 4-digit PIN code | nʳ | 104 | 10,000 |
| 5-card poker hand | nCr | 52C5 | 2,598,960 |
| 6 of 49 lottery ticket | nCr | 49C6 | 13,983,816 |
| 3 scoops from 8 flavors, repeats allowed | C(n+r−1, r) | C(10, 3) | 120 |
| Arrange all 8 letters of a word with no repeats | nPn = n! | 8! | 40,320 |
Results grow very quickly. 52! (all orderings of a deck of cards) has 68 digits, which is why this calculator works with exact big integers instead of floating-point numbers.
Frequently asked questions
What is the difference between a permutation and a combination?
In a permutation the order matters (gold, silver, bronze are different results), in a combination it does not (a lottery ticket with 1-2-3 is the same as 3-2-1). For the same n and r, nPr is always r! times larger than nCr.
What is the nPr formula?
nPr = n! ÷ (n − r)!. It multiplies the r numbers from n down: 10P3 = 10 × 9 × 8 = 720.
What is the nCr formula?
nCr = n! ÷ (r! × (n − r)!), also written C(n, r) or "n choose r". 10C3 = 720 ÷ 6 = 120. These numbers form Pascal's triangle.
How do I count combinations with repetition?
When items can be picked more than once and order does not matter, use C(n + r − 1, r). Three scoops from 8 flavors (repeats allowed) give C(10, 3) = 120 choices.
How many 4-digit PIN codes are there?
Each of the 4 positions can be any of 10 digits and digits can repeat, so there are 10⁴ = 10,000 codes. That is a permutation with repetition, nʳ.
What are the odds of winning a 6 of 49 lottery?
There are 49C6 = 13,983,816 possible tickets, so a single ticket has a 1 in 13,983,816 chance of matching all six numbers.
Why is nC0 equal to 1?
There is exactly one way to choose nothing: the empty selection. Likewise nCn = 1 and 0! = 1 by definition.