Skip to content

Permutation and Combination Calculator

Enter how many items there are (n) and how many you pick (r), then say whether order matters and whether items can repeat. The probability calculator gives the chance of an outcome; this one counts the outcomes themselves, exactly, which is usually the first half of a probability problem.

Whole number, 0 to 10,000.

Whole number, 0 to 10,000.

Does the order matter?
Can an item be picked more than once?

Result

Combinations C(5, 3)

10

Order does not matter and nothing repeats, like picking a team of 3 from 5 people.

Order matters, no repeats (nPr)
60
Order ignored, no repeats (nCr)
10
Order matters, repeats allowed (nʳ)
125
Order ignored, repeats allowed
35
Show the working
  1. Formula: n! ÷ (r! × (n − r)!)5! ÷ (3! × 2!) = C(5, 3)
  2. Choosing r to keep is the same as choosing n − r to leave out; use the smallerC(5, 3) = C(5, 2)
  3. Cancel the larger factorial below(5 × 4) ÷ (2 × 1) = 20 ÷ 2
  4. Divide20 ÷ 2 = 10

Counts are exact whole numbers. Values longer than 15 digits are also shown rounded in scientific notation.

All 10 selections

Items A, B, C, D, E, 3 at a time. Order is ignored, so AB and BA are the same selection and listed once.

  1. ABC
  2. ABD
  3. ABE
  4. ACD
  5. ACE
  6. ADE
  7. BCD
  8. BCE
  9. BDE
  10. CDE

How the permutation and combination calculator works

Counting problems come down to two questions. Does the order matter? A race podium (first, second, third) is ordered; a lottery ticket or a committee is not. Can an item be used again? A PIN can repeat digits; people on a podium cannot repeat. The two answers pick one of four formulas, and the calculator shows all four side by side so you can see how much the choice changes the count.

Results are exact whole numbers, however long. A 52-card deck can be ordered in 52! ways, a number with 68 digits, and you get every one of them. For up to 8 items and 120 results the calculator also lists every selection, using the letters A, B, C, … for the items, which is the quickest way to see why the formulas work.

To turn a count into a chance, divide the favorable outcomes by all outcomes, or use the probability calculator, which works with the binomial distribution directly. To draw an actual random selection, use the random number generator.

Which one do I need?

  • Order matters, no repeats: permutation nPr. Gold, silver and bronze among 10 runners; seating 4 guests in 4 of 6 chairs; the order of songs on a playlist.
  • Order ignored, no repeats: combination nCr. A 5-card poker hand; 6 lottery numbers; a team of 3 picked from a class.
  • Order matters, repeats allowed: nʳ. A 4-digit PIN (10⁴ = 10,000); a license plate; the results of rolling a die 3 times in sequence.
  • Order ignored, repeats allowed: C(n + r − 1, r). A dozen doughnuts from 3 kinds; 3 scoops of ice cream from 5 flavors; how many of each coin make up a handful.

Formulas

nPr = n! ÷ (n − r)! = n × (n − 1) × … × (n − r + 1)

nCr = n! ÷ (r! × (n − r)!) = nPr ÷ r!

n × n × … × n = nʳ

C(n + r − 1, r) = (n + r − 1)! ÷ (r! × (n − 1)!)

n
how many different items there are to choose from
r
how many are chosen
n!
n factorial, 1 × 2 × 3 × … × n, with 0! = 1

A combination is a permutation with the order forgotten. Each group of r items can be arranged in r! orders, so dividing nPr by r! leaves one count per group. Nobody multiplies out the full factorials: (n − r)! cancels against the bottom of n!, which is why 10P3 is simply 10 × 9 × 8.

The with-repetition combination formula comes from the “stars and bars” picture: r picks (stars) are split into n kinds by n − 1 dividers (bars), and choosing which r of the n + r − 1 positions are stars gives every possible selection exactly once.

Worked example: 3 from 5, and 3 from 10

Choose 3 of 5 items (A, B, C, D, E), the calculator's starting values:

  1. Order ignored, no repeats: 5C3 = 5! ÷ (3! × 2!) = (5 × 4) ÷ (2 × 1) = 10: ABC, ABD, ABE, ACD, ACE, ADE, BCD, BCE, BDE, CDE.
  2. Order matters, no repeats: 5P3 = 5 × 4 × 3 = 60, since each of the 10 groups can be ordered 3! = 6 ways.
  3. Order matters, repeats allowed: 5³ = 125.
  4. Order ignored, repeats allowed: C(5 + 3 − 1, 3) = C(7, 3) = (7 × 6 × 5) ÷ (3 × 2 × 1) = 35.

With 10 items: 10P3 = 10 × 9 × 8 = 720 ordered podiums, 10C3 = 720 ÷ 6 = 120 teams, 10³ = 1,000 three-digit codes and C(12, 3) = 220 selections with repeats. For larger numbers: a poker hand is 52C5 = 2,598,960 and a 6-from-49 lottery ticket is one of 49C6 = 13,983,816.

Common mistakes

  • Using a permutation for a committee. If swapping two chosen items gives the same outcome, order does not matter; use nCr. A permutation would count each committee r! times.
  • Identical items. These formulas assume the n items are all different. Arranging the letters of BOOK is 4! ÷ 2! = 12, not 24, because the two Os look the same; divide by the factorial of each repeat count.
  • r larger than n. Without repetition you cannot pick more items than exist, so the count is 0. With repetition any r works: a 6-digit PIN uses only 10 digits.
  • 0 and 0!. There is exactly one way to choose nothing, so nC0 = 1 and 0! = 1. That also makes nCn = 1.

Limits

n and r can each be any whole number from 0 to 10,000. Results are exact; values up to 1,000 digits are printed in full, longer ones show their first and last 30 digits along with the digit count and a rounded scientific value. Selections are listed only for up to 8 items and 120 results. Circular arrangements and arrangements of identical items need adjusted formulas that this calculator does not apply.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts ordered arrangements and a combination counts unordered groups. Picking 3 of 10 people for gold, silver and bronze is a permutation (720 ways); picking 3 of 10 for a team is a combination (120 ways), because the 6 orders of each team are the same team.

How do you calculate nCr?

Multiply the r largest numbers from n downward, then divide by r!. For 10C3 that is (10 × 9 × 8) ÷ (3 × 2 × 1) = 720 ÷ 6 = 120. If r is more than half of n, use n − r instead, since 10C7 = 10C3.

What does n choose r mean?

It is another name for the combination count nCr, written C(n, r) or as n over r in brackets. It is also the binomial coefficient: the number in row n, position r of Pascal's triangle.

Why is 0! equal to 1?

There is exactly one way to arrange nothing, the empty arrangement. Defining 0! = 1 also keeps the formulas working at the edges: nCn = n! ÷ (n! × 0!) = 1 and nP0 = 1.

How many 4-digit PINs are there?

Each of the 4 positions can be any of 10 digits, and digits can repeat, so there are 10⁴ = 10,000. If no digit may repeat, it is 10P4 = 10 × 9 × 8 × 7 = 5,040.

Sources

Last reviewed September 19, 2026