Find the number of permutations (order matters) and combinations (order does not matter) for choosing r items from n, with or without repetition, with exact results.
Working
Permutations count arrangements where order matters; combinations count selections where order doesn't. Results are exact whole numbers, however large.
A permutation and combination calculator counts how many ways you can choose r items from a set of n, either when the order matters (permutations) or when it doesn’t (combinations), with or without repetition. It gives exact answers however large they get, shows the factorial formulas with your numbers, and lists the related counts side by side so you can compare them.
For example, choosing 3 items from 10 gives 720 permutations but only 120 combinations. A standard 52-card deck gives 2,598,960 different five-card poker hands, and a 6-from-49 lottery has 13,983,816 possible combinations.
The key question is: does the order matter?
Every combination of r items can be arranged in r! different orders, so there are always r! times as many permutations as combinations. For 3 items, 3! = 6, which is why 720 ÷ 6 = 120.
| Type | Order matters? | Repetition? | Formula |
|---|---|---|---|
| Permutation | Yes | No | P(n, r) = n! ÷ (n − r)! |
| Combination | No | No | C(n, r) = n! ÷ (r! × (n − r)!) |
| Permutation with repetition | Yes | Yes | nr |
| Combination with repetition | No | Yes | C(n + r − 1, r) |
The exclamation mark means factorial: n! = n × (n − 1) × … × 2 × 1. So 5! = 120. By definition, 0! = 1. Combinations are also written as ⁿCᵣ, ₙCᵣ or “n choose r”, and permutations as ⁿPᵣ or ₙPᵣ.
Eight runners compete for gold, silver and bronze. Order matters and no runner can win two medals, so the number of possible podiums is P(8, 3) = 8 × 7 × 6 = 336.
A club picks 4 members from 12 for a committee. Order doesn’t matter, so the number of possible committees is C(12, 4) = (12 × 11 × 10 × 9) ÷ (4 × 3 × 2 × 1) = 11,880 ÷ 24 = 495.
A 4-digit PIN uses digits 0 to 9, and digits can repeat. Each of the four positions has 10 choices, so there are 10⁴ = 10,000 possible PINs.
You choose 3 scoops from 5 flavours, and you can have the same flavour more than once. The order of scoops in the cup doesn’t matter, so the count is C(5 + 3 − 1, 3) = C(7, 3) = 35.
In a lottery where you pick 6 numbers from 49, the order of the numbers doesn’t matter, so there are C(49, 6) = 13,983,816 possible tickets. Your chance of matching all six with one ticket is 1 in 13,983,816.
Factorials grow extremely fast. 10! is 3,628,800, and 52!, the number of ways to shuffle a deck of cards, has 68 digits. That’s so large that every properly shuffled deck in history has almost certainly been in an order never seen before. This calculator uses exact whole-number arithmetic, so it gives precise answers for very large values, and shows them in scientific notation alongside the exact digits.
For instance, a licence plate with 3 letters followed by 3 digits, where repeats are allowed, has 26 × 26 × 26 × 10 × 10 × 10 = 17,576,000 possibilities. Each position is filled independently, so you multiply the choices.
When some of the items are identical, swapping them doesn’t create a new arrangement, so you divide by the factorial of each repeat count. The word LEVEL has 5 letters, with L appearing twice and E appearing twice. The number of distinct arrangements is 5! ÷ (2! × 2!) = 120 ÷ 4 = 30. The word BANANA has 6 letters, with A three times and N twice, giving 6! ÷ (3! × 2!) = 720 ÷ 12 = 60 distinct arrangements. This is sometimes called a multinomial or a permutation of a multiset.
Seating people around a round table is different from seating them in a row, because rotating everyone one seat to the left gives the same arrangement. To count circular arrangements of n people, fix one person’s seat and arrange the others: (n − 1)!. Six people around a round table can be seated in 5! = 120 different ways, compared with 6! = 720 ways in a row. If clockwise and anticlockwise orders count as the same, such as beads on a necklace that can be flipped over, divide by 2 again.
Combinations are the backbone of many probability questions. The probability of an outcome is the number of favourable combinations divided by the total number of combinations. For example, what’s the chance that a five-card hand contains all four aces? There are 48 ways to choose the fifth card, and C(52, 5) = 2,598,960 hands in total, so the probability is 48 ÷ 2,598,960, or about 1 in 54,145. In a lottery where you pick 6 numbers from 49, the chance of matching exactly 3 is C(6, 3) × C(43, 3) ÷ C(49, 6) = 20 × 12,341 ÷ 13,983,816, about 1.77%, or roughly 1 in 57.
Permutations and combinations appear far beyond the classroom. Security experts use them to measure how hard a password is to guess. Scientists count the possible orders of genes or proteins. Sports leagues count fixture lists, schedulers count possible rotas, and card players and game designers rely on them to work out odds. Whenever you need to know “how many ways”, one of these four formulas is usually the starting point.
You may also find the probability calculator useful to find the probability of combined events, while the random number generator lets you generate random numbers in any range.
In a permutation the order matters; in a combination it doesn't. ABC and CBA are two permutations but one combination.
nPr = n! ÷ (n − r)!. For 10P3, that's 10 × 9 × 8 = 720.
nCr = n! ÷ (r! × (n − r)!). For 10C3, that's 720 ÷ 6 = 120.
0! = 1. There's exactly one way to arrange zero items, and this definition keeps the formulas consistent.
C(52, 5) = 2,598,960, because the order of cards in a hand doesn't matter.
10⁴ = 10,000, from 0000 to 9999, since each digit can be any of 10 and digits can repeat.
A selection where order doesn't matter and items can be chosen more than once, such as scoops of ice cream. The count is C(n + r − 1, r).
Because the order of the numbers matters. Mathematically it's a permutation with repetition.
Only when repetition is allowed. Without repetition you can't choose more distinct items than there are.
1 in 13,983,816 for a single ticket, because there are C(49, 6) possible combinations.
n and r can each be up to 10,000. The calculator uses exact arithmetic and shows very large results in scientific notation with the number of digits.
(6 − 1)! = 120, because rotating everyone by one seat gives the same arrangement.
5! = 120, since every person can sit in any remaining seat and order matters.