🔢 Permutation and Combination Calculator
By ToolNimba Editorial Team · Updated 2026-06-19
Enter n and r with n greater than or equal to r, and both 0 or more.
This permutation and combination calculator works out nPr and nCr for any pair of whole numbers n and r. Enter the total number of items (n) and how many you are choosing (r), and you will see both results at once: the number of ordered arrangements (permutations) and the number of unordered selections (combinations). Results stay exact even for large values, so you can trust the count.
What is the Permutation and Combination Calculator?
Permutations and combinations both count how many ways you can pick r items from a set of n items, but they answer slightly different questions. A permutation counts ordered arrangements, so picking gold, then silver, then bronze is different from picking bronze, then silver, then gold. A combination counts unordered selections, so a group of three people is the same group no matter what order you name them in.
The two are linked by a simple idea: every combination of r items can be arranged in r! different orders, so there are always at least as many permutations as combinations. In fact nPr is exactly r! times nCr. That is why nCr is found by taking nPr and dividing out the r! orderings you do not care about. When order matters, use permutations; when it does not, use combinations.
A quick test helps you choose the right one. Ask yourself whether swapping two of the chosen items would create a genuinely different result. If yes (as with the digits of a PIN or the finishing places in a race), you want permutations. If no (as with a hand of cards or a committee), you want combinations. This calculator shows both so you can compare them directly.
When to use it
- Counting how many ways a race can finish for the top positions (order matters, so permutations).
- Working out how many different lottery tickets or card hands are possible (order does not matter, so combinations).
- Checking probability homework or statistics coursework where nPr and nCr appear.
How to use the Permutation and Combination Calculator
- Enter the total number of items you are choosing from in the n field.
- Enter how many items you are choosing in the r field, keeping r no larger than n.
- Read the permutations result (nPr) for ordered arrangements.
- Read the combinations result (nCr) for unordered selections.
Formula & method
Worked examples
Choosing 2 items from 5 (n = 5, r = 2).
- nPr = 5! / (5 - 2)! = 120 / 6 = 20
- r! = 2! = 2
- nCr = nPr / r! = 20 / 2 = 10
Result: 20 permutations, 10 combinations
A 3-place podium from 10 runners (n = 10, r = 3).
- nPr = 10 x 9 x 8 = 720
- r! = 3! = 6
- nCr = 720 / 6 = 120
Result: 720 permutations, 120 combinations
A 5-card hand from a 52-card deck (n = 52, r = 5).
- nPr = 52 x 51 x 50 x 49 x 48 = 311,875,200
- r! = 5! = 120
- nCr = 311,875,200 / 120 = 2,598,960
Result: 311,875,200 permutations, 2,598,960 combinations
Permutations vs combinations for small n and r
| n | r | nPr (ordered) | nCr (unordered) |
|---|---|---|---|
| 5 | 2 | 20 | 10 |
| 6 | 3 | 120 | 20 |
| 10 | 3 | 720 | 120 |
| 10 | 5 | 30,240 | 252 |
| 52 | 5 | 311,875,200 | 2,598,960 |
When to use each
| Question | Order matters? | Use |
|---|---|---|
| Ways to arrange race finishers | Yes | Permutation (nPr) |
| Ways to form a committee | No | Combination (nCr) |
| Number of possible PINs | Yes | Permutation (nPr) |
| Number of possible lottery draws | No | Combination (nCr) |
Common mistakes to avoid
- Using permutations when order does not matter. A poker hand or a committee is the same set whatever order you list its members in, so you want nCr, not nPr. Using permutations there over-counts by a factor of r!.
- Setting r larger than n. You cannot choose more items than you have, so r must be no larger than n. If r is greater than n, both nPr and nCr are simply 0.
- Confusing factorial with permutation. n! arranges all n items, while nPr arranges only r of them. Use nPr when you are choosing and ordering a subset, not the whole set.
- Forgetting that nCr is symmetric. Choosing r from n equals choosing the n minus r you leave behind, so nCr equals nC(n minus r). For example 10C3 equals 10C7, both 120.
Glossary
- Permutation
- An ordered arrangement of r items chosen from n. Different orderings count as different permutations.
- Combination
- An unordered selection of r items chosen from n. Order does not matter, so it counts groups, not arrangements.
- Factorial (n!)
- The product of all whole numbers from 1 up to n. For example 5! = 5 x 4 x 3 x 2 x 1 = 120, and 0! is defined as 1.
- nPr
- The number of permutations of r items from n, equal to n! divided by (n minus r)!.
- nCr
- The number of combinations of r items from n, equal to n! divided by r! times (n minus r)!. Also called the binomial coefficient.
Frequently asked questions
What is the difference between a permutation and a combination?
A permutation counts ordered arrangements, so the order of the chosen items matters. A combination counts unordered selections, so it ignores order. For the same n and r, there are always at least as many permutations as combinations.
What are the formulas for nPr and nCr?
nPr equals n! divided by (n minus r)!, and nCr equals n! divided by r! times (n minus r)!. They are linked because nCr equals nPr divided by r!.
How do I decide whether to use nPr or nCr?
Ask whether swapping two chosen items would create a different result. If yes (a race ranking or a PIN), use permutations. If no (a card hand or a committee), use combinations.
What does 0! equal and why?
0! is defined as 1. This convention keeps the formulas consistent, for example nCn equals n! divided by n! times 0!, which should be 1, and only works if 0! is 1.
Can r be larger than n?
No. You cannot choose more items than you have, so r must be no larger than n. If r is greater than n, both nPr and nCr are 0. This calculator asks you to keep r no larger than n.
Why does this calculator stay exact for large numbers?
It uses whole-number (big integer) arithmetic instead of decimals, so results like 52 choose 5 equal exactly 2,598,960 with no rounding. Standard floating-point math would lose precision for large factorials.