Home › Math › Permutation and Combination Calculator

Permutation and Combination Calculator

Find nPr and nCr for any n and r, with and without repetition, and see the formula for each.

Both must be whole numbers. n can be 1 to 1,000 and r can be 0 to 1,000.

Combinations, C(n, r)

-

n!-
r!-
(n − r)!-

All four counts for the same n and r

TypeFormulaResult

What is the difference between a permutation and a combination?

Both count the ways of choosing r items from n items. In a permutation the order matters, so choosing A then B is different from choosing B then A. In a combination the order does not matter, so A and B is the same choice either way round.

Permutations: P(n, r) = n! ÷ (n − r)!
Combinations: C(n, r) = n! ÷ (r! × (n − r)!)
Permutations with repetition: n^r
Combinations with repetition: (n + r − 1)! ÷ (r! × (n − 1)!)

The symbol n! is "n factorial", the product of every whole number from 1 up to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120, and 0! is defined as 1.

Example: choosing 3 from 10

Say 10 students compete and 3 are chosen. If you only want to pick a team of 3, order does not matter. That is C(10, 3) = 120 ways. If the 3 get gold, silver and bronze, order matters. That is P(10, 3) = 10 × 9 × 8 = 720 ways. Each team of 3 can be ranked in 3! = 6 orders, and 120 × 6 = 720.

Example: a hand of cards

A hand of 5 cards from a pack of 52 is a combination, because the order you receive the cards does not change the hand. C(52, 5) = 25,98,960 hands.

When to use which

  • Use permutations for arranging, ranking, seating, passwords or codes where position matters.
  • Use combinations for choosing a team, a committee, a lottery ticket or a hand of cards where only the group matters.
  • Use "with repetition" when the same item can be picked more than once, such as a PIN where digits can repeat. A 4-digit PIN has 10^4 = 10,000 possibilities.
  • You cannot choose more than n items if you cannot repeat. In that case P(n, r) and C(n, r) are both 0.

Results that are too large to show in full are given in scientific notation, such as 1.0089 × 10^29. The full digits are shown under the answer. For more number tools, try the Standard Deviation Calculator or the Mean Median Mode Calculator.

Need another calculator?

Browse all calculators
Scroll to Top