Permutation and Combination Calculator

Enter how many items there are and how many you pick, and get the number of permutations (order matters) and combinations (order does not).

Whole numbers from 0 to 999,999. The number you pick (r) cannot be bigger than n.

Permutation or combination: the one question that decides it

Ask yourself: would swapping two of the chosen items give a different result? If yes, order matters, and you want permutations. If no, you want combinations. Picking a gold, silver and bronze medallist from 8 runners is a permutation, because the same three people in a different order is a different outcome. Picking 3 of the 8 to form a committee is a combination, because the group is the same whatever order you name them in.

The two formulas

Permutations, nPr = n! ÷ (n − r)!. Combinations, nCr = n! ÷ (r! × (n − r)!). Every combination can be arranged in r! different orders, which is why nCr is nPr divided by r!. For the medal example, 8P3 = 8 × 7 × 6 = 336 ways to award the medals, while 8C3 = 336 ÷ 6 = 56 possible committees.

Real-life counts that are worth knowing

The number of five-card poker hands from a 52-card deck is 52C5 = 2,598,960. A 6-number lottery drawn from 49 balls has 49C6 = 13,983,816 possible tickets, so one ticket has a 1 in about 14 million chance of the jackpot. If you want to turn counts into odds, the Probability Calculator picks up where this one leaves off: the chance of a specific outcome is 1 divided by the number of equally likely possibilities.

When items can repeat

The formulas above assume each item can be used once. A 4-digit PIN is different, since digits can repeat, so there are 10 × 10 × 10 × 10 = 104 = 10,000 arrangements. That is the "with repetition" line in the results: nr for ordered picks, and C(n + r − 1, r) for unordered picks, such as choosing 3 scoops from 6 ice cream flavours where you can repeat a flavour (56 ways). Choose the "with repetition" figure whenever the same item can come up more than once.

Very large answers

Factorials grow extremely fast. 20! is already over 2 quintillion, and 100! has 158 digits. For answers up to a few thousand digits the calculator gives you the exact whole number. Beyond that, it shows the size in scientific notation, since nobody can use a 300,000-digit number in practice. If you are working with sets that big, you are usually after a probability, not the raw count.

Where to go next

Counting possibilities is usually step one. To turn a count into the odds of an event, use the Probability Calculator. If your data is a list of numbers rather than a counting problem, the Statistics Calculator summarises it. And for questions about how many people you need to survey, rather than how many ways something can happen, the Sample Size Calculator is the right tool.

Quick check: nPr is always at least as big as nCr, and the two are equal only when r is 0 or 1. If your combination count comes out larger than your permutation count, something went wrong.

Common questions

What is the difference between a permutation and a combination?

In a permutation the order of the chosen items matters. In a combination it does not. For the same n and r there are always at least as many permutations as combinations.

How do you calculate nCr?

Use n! ÷ (r! × (n − r)!). For 6C2 that is 720 ÷ (2 × 24) = 15.

What is 0! equal to?

0! is defined as 1. That is why nC0 and nCn are both 1: there is exactly one way to choose nothing, and one way to choose everything.

Can r be larger than n?

Not when items cannot repeat, because you cannot pick more items than exist. With repetition allowed, r can be larger than n, and the n^r formula still applies.

How many different 5-card poker hands are there?

There are 2,598,960 hands, which is 52C5.

More Math Calculators

Pick another tool to jump straight to it.