Permutation and Combination Calculator

Permutation & Combination Calculator

Count arrangements or selections from any set of items

Say your teacher gives you a problem: how many different 5-card hands are possible from a 52-card deck?

Or you want to know how many unique 4-digit PINs you can set. These are counting problems, and permutations and combinations are the tools that solve them.

The calculator above handles all four variations: permutations and combinations, each with or without repetition.

Enter your values, pick the type, and the calculator shows you the result with a step-by-step breakdown so you can follow the math.

This article explains the formulas behind each calculation, how to read your result, and how to do it all in Excel with just a single function.


How Permutations and Combinations Work?

The core question that separates the two: does order matter?

If you're assigning 1st, 2nd, and 3rd place in a race, order matters. That's a permutation.

If you're picking three people for a committee and it doesn't matter who gets named first, order doesn't matter. That's a combination.

Then there's the repetition question: can you pick the same item more than once? A PIN allows repeated digits (1-1-1-1 is valid). Choosing 3 people from a team of 10 doesn't allow the same person twice.

That gives you four scenarios:

Permutation without repetition

Use this when order matters and each item can only be used once.

Formula: P(n, r) = n! / (n - r)!

Example: How many ways can a gold, silver, and bronze medal be awarded from 10 athletes?

P(10, 3) = 10! / 7! = 10 x 9 x 8 = 720

Permutation with repetition

Use this when order matters and items can repeat.

Formula: P(n, r) = n^r

Example: How many 4-digit PINs are possible using digits 0-9?

P(10, 4) = 10^4 = 10,000

Combination without repetition

Use this when order doesn't matter and each item can only be used once.

Formula: C(n, r) = n! / (r! x (n - r)!)

Example: How many different 5-card poker hands can be dealt from a 52-card deck?

C(52, 5) = 52! / (5! x 47!) = 2,598,960

Combination with repetition

Use this when order doesn't matter but items can repeat (also called a multiset coefficient).

Formula: C(n + r - 1, r) = (n + r - 1)! / (r! x (n - 1)!)

Example: How many ways can you pick 3 scoops of ice cream from 5 flavors (repeats allowed)?

C(5 + 3 - 1, 3) = C(7, 3) = 7! / (3! x 4!) = 35

How to Use This P&C Calculator

  1. Total Items (n): Enter the size of your full set. For a 52-card deck, that's 52. For a race with 10 runners, that's 10.
  2. Items Chosen (r): Enter how many you are selecting or arranging. For a 5-card hand, that's 5. For a 3-person podium finish, that's 3.
  3. Calculation Type: Choose Permutation if order matters; Combination if it doesn't.
  4. Allow Repetition: Check this box if the same item can appear more than once in your selection. Leave it unchecked for most real-world problems.
  5. Click Calculate: Your result appears along with the formula and a step-by-step breakdown showing exactly how the number was computed.

Note: r cannot exceed n when repetition is turned off. The calculator will warn you if this happens.


How to Interpret Your Result

The number you get is a count of distinct outcomes. A result of 720 means there are exactly 720 different arrangements or selections possible given your inputs.

A few things to keep in mind:

Large numbers are normal. Combinatorics results grow fast. C(52, 5) is nearly 2.6 million. That's why shuffled card decks are effectively never in the same order twice. When your result runs into the millions or billions, that just reflects how quickly possibilities multiply.

Zero is valid. C(n, 0) and P(n, 0) both equal 1, not 0. There is exactly one way to choose nothing: choose nothing. This is a mathematical convention that keeps formulas consistent.

Combination results are always smaller than permutation results for the same n and r. C(n, r) = P(n, r) / r!. Because combinations ignore order, multiple permutations collapse into a single combination.

Repetition pushes the count much higher. For permutations, switching from no repetition to repetition changes the formula from n!/(n-r)! to n^r. For large r values, that difference is enormous.


How to Calculate This in Excel

Excel has four built-in functions that match the four calculation types exactly.

Permutation without repetition:

=PERMUT(n, r)

=PERMUT(10, 3) returns 720.

Permutation with repetition:

=PERMUTATIONA(n, r)

=PERMUTATIONA(10, 4) returns 10,000.

Combination without repetition:

=COMBIN(n, r)

=COMBIN(52, 5) returns 2,598,960.

Combination with repetition:

=COMBINA(n, r)

=COMBINA(5, 3) returns 35.

A few gotchas:

  • PERMUTATIONA and COMBINA were added in Excel 2013. If you're on an older version, these functions won't work. You'd need to write the formula manually: =(FACT(n+r-1))/(FACT(r)*FACT(n-1)) for combination with repetition.
  • PERMUT and COMBIN round their inputs to integers silently. If you pass 10.9 as n, Excel treats it as 10 without any warning. Always feed these functions clean integer values.
  • For very large inputs, Excel returns a #NUM! error when the result exceeds its numeric limits. The calculator on this page uses BigInt arithmetic and can handle results far beyond what Excel manages.

Common Mistakes to Avoid

Using permutation when you need combination (or vice versa). This is the most common error. Ask yourself: if I swap the order of my selections, do I get a different outcome? A committee of Alice, Bob, and Carol is the same committee no matter what order you name them. A 1st-2nd-3rd finish is not. When in doubt, write out two sample outcomes and check whether they're the same or different.

Setting r greater than n with repetition turned off. You can't choose 5 people from a group of 3 if each person can only be chosen once. Always confirm r is no greater than n in the no-repetition case.

Forgetting that C(n, r) = C(n, n-r). The number of ways to choose 3 items from 10 is the same as the number of ways to exclude 7 items from 10. This symmetry is useful for simplifying calculations and verifying your answer. =COMBIN(10, 3) and =COMBIN(10, 7) both return 120.

Treating factorial results as probabilities. P(10, 3) = 720 tells you how many arrangements exist. It doesn't tell you the probability of any one arrangement. For probability, you'd divide by the total number of possible outcomes.

Not accounting for identical items. Standard permutation formulas assume all items are distinct. If some items are identical (e.g., arranging the letters in "MISSISSIPPI"), you need to divide by the factorial of each repeated item's count. This calculator handles distinct items only.


Frequently Asked Questions

What is the difference between a permutation and a combination?
A permutation counts arrangements where order matters. A combination counts selections where order doesn't matter. Choosing team members for a group project is a combination. Assigning first, second, and third place ribbons is a permutation.

When should I allow repetition?
Allow repetition when the same item can appear more than once. A PIN is a good example: 1-1-1-1 is a valid PIN, so digits repeat. Choosing people for a committee typically doesn't allow the same person twice, so repetition stays off for those problems.

Why is C(n, 0) equal to 1?
There is exactly one way to choose zero items from a set: choose nothing. This isn't a quirk. It's a consistent mathematical convention that makes formulas work correctly at boundary values, especially in binomial theorem expansions.

What is the largest value I can calculate?
This calculator uses JavaScript BigInt, which handles arbitrarily large integers. In practice, you can calculate C(170, 85) and similar large values without losing precision. Excel's COMBIN and PERMUT functions cap out around 10^307 before returning a #NUM! error.

Is there an Excel formula for combination with repetition?
Yes. =COMBINA(n, r) works in Excel 2013 and later. For older versions, use =FACT(n+r-1)/(FACT(r)*FACT(n-1)) to compute it manually.

How do I calculate the number of possible passwords?
Use permutation with repetition. If your password has r characters and n possible characters per position (e.g., 26 letters), the formula is n^r. A 4-character lowercase password has 26^4 = 456,976 possibilities. Adding uppercase doubles your alphabet to 52, giving 52^4 = 7,311,616 possibilities.

Related Articles / Calculators

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.