Permutation and Combination Calculator
Count the ways to arrange or choose r items from n, with or without repetition.
How to use the Permutation and Combination Calculator
- Enter Total number of items (n).
- Enter Number chosen (r).
- Read your answer in the results panel. It updates as you type, and the breakdown, step-by-step working and any charts or tables appear below it.
- Use Share link to save or send the exact calculation, or Copy to paste the results elsewhere.
Order matters or not?
The key question is whether swapping the order of the chosen items creates a different outcome.
- Permutations count ordered arrangements: gold, silver and bronze medals, a PIN code, the batting order of a team.
- Combinations count unordered selections: a lottery ticket, a committee, the toppings on a pizza.
nPr = n! ÷ (n − r)! nCr = n! ÷ (r! × (n − r)!)
The factorial n! means n × (n − 1) × … × 1. Since every combination of r items can be arranged in r! orders, nCr = nPr ÷ r!.
Worked example
Ten runners compete for gold, silver and bronze. The number of possible podiums is 10P3 = 10 × 9 × 8 = 720. If instead we only ask which three runners reach the final, order no longer matters: 10C3 = 720 ÷ 3! = 720 ÷ 6 = 120.
A standard 52-card poker hand is a combination of 5 cards: 52C5 = 2,598,960 different hands.
With repetition
Sometimes an item can be chosen more than once.
| Type | Formula | n = 10, r = 3 |
|---|---|---|
| Permutations with repetition | nʳ | 1,000 (three-digit codes 000–999) |
| Combinations with repetition | C(n + r − 1, r) | 220 (scoops from 10 flavours, repeats allowed) |
The second formula is the “stars and bars” method: choosing r items from n types with repeats is equivalent to arranging r stars and n − 1 dividing bars.
Exact big numbers
Factorials grow explosively. 20! already exceeds 2 × 10¹⁸, beyond the range where ordinary floating-point numbers are exact. This calculator uses big-integer arithmetic, so a result such as 100C50 (a 30-digit number) is shown digit for digit, with the scientific form and digit count beside it.
Tips
- nCr = nC(n − r): choosing 3 runners to advance is the same as choosing 7 to eliminate.
- If r is larger than n, there are no ways to pick without repetition, so nPr and nCr are 0.
- To turn a count into a probability, divide the favourable outcomes by the total outcomes. The chance of one particular 6-from-49 lottery ticket winning is 1 in 13,983,816.
Frequently asked questions
What is the difference between a permutation and a combination?
A permutation is an arrangement where order matters (ABC differs from CBA). A combination is a selection where order does not matter (ABC is the same as CBA).
How many combinations does a 4-digit PIN have?
Digits can repeat and order matters, so it is a permutation with repetition: 10⁴ = 10,000. Strictly, it should be called a permutation rather than a combination.
What is 0! and why?
0! is defined as 1. There is exactly one way to arrange nothing, and the definition keeps formulas like nCn = 1 working.
How many 5-card poker hands are there?
52C5 = 2,598,960, because the order in which you receive the cards does not matter.