Permutation and Combination Calculator

MathLast updated: August 17, 2026

A permutation P(n, r) is the number of ORDERED arrangements of r items taken from a set of n; a combination C(n, r) is the number of SELECTIONS made without regard to order. Choosing a president and a deputy from three people is a permutation (order matters), while choosing two representatives from three people is a combination (order does not matter).

This calculator returns both values at once, shows the factor of r! between them, and for n ≤ 20 plots the distribution of the C(n, r) values (a row of Pascal's triangle). Results are exact whole numbers for n up to 170; very large results are shown in scientific notation.

The total number of items you are selecting or arranging from.
How many items will be arranged or selected (r must be ≤ n).

Formula

P(n, r) = n! / (n − r)! = n × (n−1) × ... × (n−r+1)
C(n, r) = n! / (r! × (n − r)!)
P(n, r) = C(n, r) × r!

Use a permutation when ORDER MATTERS and a combination when it does not. 'How many different passcodes?' is a permutation, 'how many different teams?' is a combination; confusing the two is the most frequent mistake.

How to Calculate

  1. Enter the total number of items (n) — for example, the 10 students in a class.
  2. Enter how many items will be selected or arranged (r).
  3. Read P(n, r) if order matters, or C(n, r) if it does not.
  4. Compare the results for the other values of r in the table and the chart.

Worked Examples

Arranging and choosing 3 out of 5 people

Choosing a president, a deputy, and a secretary from 5 people (order matters) can be done in P(5, 3) = 5 × 4 × 3 = 60 ways; forming a team of 3 (order does not matter) can be done in C(5, 3) = 10 ways. The difference is exactly 3! = 6 times.

Permutation P(5, 3) — ordered arrangement: 60 · Combination C(5, 3) — unordered selection: 10 · Factor between them: P / C = r! = 3!: 6

Top two places in a 10-team league

Deciding the champion and the runner-up among 10 teams produces P(10, 2) = 90 different outcomes, while which two teams finish on top can happen in C(10, 2) = 45 ways.

Permutation P(10, 2) — ordered arrangement: 90 · Combination C(10, 2) — unordered selection: 45 · Factor between them: P / C = r! = 2!: 2

Lottery: 6 numbers out of 49

In the classic 6-from-49 lottery order does not matter: there are C(49, 6) = 13,983,816 different tickets, so a single ticket has a 1 in 13,983,816 chance of matching all six numbers. The number of ordered arrangements is P(49, 6) = 10,068,347,520.

Permutation P(49, 6) — ordered arrangement: 10,068,347,520 · Combination C(49, 6) — unordered selection: 13,983,816 · Factor between them: P / C = r! = 6!: 720

Frequently Asked Questions

What is the difference between a permutation and a combination?
In a permutation the order of the selected items matters; in a combination it does not. The arrangements A-B-C and C-B-A are two separate results as permutations but a single selection as a combination. That is why P(n, r) is always r! times C(n, r).
Which questions call for a permutation and which for a combination?
If the question mentions arranging, ordering, a passcode, a finishing position, or assigning roles, it is usually a permutation. If it mentions a selection, a team, a group, a committee, or a hand of cards, it is a combination. When in doubt, ask whether swapping two of the chosen items counts as a new result.
Why are C(n, 0) and P(n, 0) equal to 1?
There is exactly one way to choose nothing: the empty selection. Mathematically, the definition 0! = 1 makes both formulas return 1.
Why does C(n, r) = C(n, n−r) hold?
Choosing r items is the same operation as deciding which n−r items will be left out. Choosing 8 people from 10, for example, is identical to choosing the 2 who stay out: C(10,8) = C(10,2) = 45.
How are permutations with repeated items calculated?
When some of the n items are identical, the number of arrangements is n! / (n₁! × n₂! × ...), where the denominators are the sizes of each identical group. The 4 distinct letters of 'MATH' can be arranged in 4! = 24 ways, while 'BOOK', with its repeated O, allows only 4!/2! = 12 arrangements.
Why is n limited to 170?
170! is roughly 7.26 × 10³⁰⁶, which is at the limit of the standard number range on computers. The calculator produces exact results within that range; values longer than 15 digits are shown in scientific notation together with their total digit count.