Boneyard Tools

Permutation and Combination Calculator

Work out how many ways you can arrange or choose r items from a set of n. Enter n and r to see permutations (nPr) and combinations (nCr) side by side, with the formulas and factorials behind each answer.

How to calculate permutations and combinations

  1. Enter n, the total number of items in your set.
  2. Enter r, how many of them you arrange or choose (0 to n).
  3. Read nPr for ordered arrangements and nCr for unordered selections.

Examples

Choosing 2 from 5

n = 5, r = 2
Permutations 20, Combinations 10

Choosing 3 from 10

n = 10, r = 3
Permutations 720, Combinations 120

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts arrangements where order matters, so ABC and CBA are different. A combination counts selections where order does not matter, so ABC and CBA are the same group. For the same n and r, there are always at least as many permutations as combinations.

When does order matter?

Order matters when the positions are distinct, such as first, second and third place in a race, a ranked podium, or a sequence like a PIN. Use combinations when you only care which items are picked, such as the players on a team or the numbers on a lottery ticket.

What are the formulas for nPr and nCr?

Permutations use nPr = n! / (n - r)!. Combinations use nCr = n! / (r! (n - r)!), which is the permutation count divided by r! to remove the duplicate orderings. The exclamation mark means factorial, the product of all whole numbers up to that value.

Can you give a real lottery and team example?

In a 6-from-49 lottery, order does not matter, so the number of possible tickets is the combination 49C6, which is 13,983,816. Picking a 5-player starting team from a squad of 12 is also a combination, 12C5 = 792. Choosing a captain, then a vice-captain from 12 is a permutation, 12P2 = 132, because the two roles are different.

What happens at the edges, like r = 0 or r = n?

Choosing zero items gives exactly one outcome (the empty selection), so nP0 and nC0 are both 1. Choosing all n items gives nCn = 1 because there is only one full set, while nPn = n! because every ordering of the full set is distinct.

Why might the factorial show as too large?

Factorials grow extremely fast and quickly exceed the largest number a browser can store exactly, so n! is shown as too large to display once it overflows. The permutation and combination results are still computed step by step and stay accurate for moderate values of n even when n! itself cannot be shown.

Related tools