Permutation and Combination Calculator

Permutations and combinations count the ways to arrange or choose things. Use a permutation (nPr) when order matters, such as awarding gold, silver and bronze. Use a combination (nCr) when it does not, such as picking a team. Enter n and r to get both, plus n factorial and the count with repetition allowed. Calculations are exact, and very large numbers are shown in scientific form.

Combinations, nCr120
Permutations, nPr
720
n factorial, n!
3,628,800
Arrangements with repetition, nʳ
1,000

How to use the Permutation and Combination Calculator (nPr, nCr)

  1. Enter n, the total number of items to choose from.
  2. Enter r, how many you pick.
  3. Read nCr for unordered choices and nPr for ordered arrangements.
  4. Use the factorial and nʳ figures when every item is used or repeats are allowed.

Formula used

nPr = n! ÷ (n − r)!. nCr = n! ÷ (r! × (n − r)!). With repetition allowed, the number of ordered choices is nʳ.

Worked example

Here is the Permutation and Combination Calculator (nPr, nCr) worked through with the example values shown above, so you can check each step by hand.

Inputs
Total items (n)10
Items chosen (r)3
Result
Combinations, nCr120
Permutations, nPr720
n factorial, n!3,628,800
Arrangements with repetition, nʳ1,000

The formulas

A factorial n! is the product 1 × 2 × … × n, and 0! is defined as 1. Permutations are nPr = n! ÷ (n − r)!. Combinations are nCr = n! ÷ (r! × (n − r)!), which is nPr divided by r! because each group of r items can be ordered in r! ways.

With n = 10 and r = 3, nPr = 10 × 9 × 8 = 720 and nCr = 720 ÷ 6 = 120.

Worked examples

How many 5-card hands can you deal from a 52-card deck? Order does not matter, so it is 52C5 = 2,598,960. A lottery where you pick 6 numbers from 49 has 49C6 = 13,983,816 possible tickets, so a single ticket has a chance of about 1 in 14 million.

If a race has 10 runners, the number of ways to fill the first three places is 10P3 = 720. All 10 runners can finish in 10! = 3,628,800 different orders.

Very large results

Counts grow quickly. 100C50 is 1.008913 × 10^29, far more than a standard calculator shows exactly. This tool uses exact whole-number arithmetic, so results up to 15 digits are shown in full and larger ones as a mantissa and a power of ten.

The input limit is n = 1,000, which keeps the calculation instant.

Repetition and common mistakes

If items can repeat, such as a PIN where each digit can be reused, the number of ordered choices is nʳ. A 4-digit PIN has 10⁴ = 10,000 possibilities.

A common mistake is to use nPr when order does not matter, which overcounts by r!. Ask yourself: would swapping two chosen items make a different outcome? If yes, it is a permutation.

Frequently asked questions

What is the difference between nPr and nCr?

nPr counts ordered arrangements, nCr counts unordered selections. nPr = nCr × r!.

What is 0 factorial?

1, by definition. It makes the formulas work when r = 0 or r = n.

Why must r be no larger than n?

You cannot pick more distinct items than you have. The calculator shows an error in that case.

How many ways can n items be arranged?

n factorial, shown in the n! result. Ten items can be arranged in 3,628,800 ways.

How do I calculate it with repetition?

For ordered choices with repeats, use nʳ, shown in the last result. For combinations with repeats the formula is (n + r − 1)C r.

How large an n can I use?

Up to 1,000. Results are exact, and large ones are displayed in scientific form.

This calculator gives estimates for information only. Actual figures from a bank, employer, tax authority or doctor may differ. It is not financial, tax, legal or medical advice.