Combination and Permutation Calculator

How many ways can you choose or arrange r items from n items?

Enter n and r, then press Calculate.

Combination and Permutation Calculator: Calculate Arrangements and Selections Easily

I opened the Combination and Permutation Calculator the night before a quiz, when five friends wanted in and I could take only three. The tool showed me both answers at once: 10 possible teams and 60 ways to line three of them up for a photo, and I picked the team in five minutes instead of arguing about it all evening.

At a glance:

  • The Combination and Permutation Calculator works out nCr and nPr side by side from two numbers, n and r.
  • The tool takes n and r, shows both answers with the steps, and needs r between 0 and n.
  • Order matters for permutations and not for combinations, and the tool shows both so you can read the right one.
  • Repetition, the combinations generator and the Has, No and Pattern rules are worked by hand in this guide, not in the tool.
  • A 4-digit PIN has 10,000 possibilities, and a 5-card poker hand has 2,598,960.

What Is a Combination and Permutation Calculator?

The Combination and Permutation Calculator on CalcSolver is the counting tool I open when a question is really “how many ways?” These counting rules sit in US Common Core Grade 7 statistics (7.SP), in UK GCSE, in India NCERT Class 11 Permutations and Combinations, in Khan Academy’s combinatorics course, and in SAT and ACT preparation, and every one of them starts with nPr and nCr.

What Is a Permutation?

A permutation is an arrangement, and the order of the items changes the answer. Three friends lined up for a photo can stand in 6 orders, because the first spot has 3 choices, the second has 2, and the last has 1, and 3 × 2 × 1 = 6.

What Is a Combination?

A combination is a selection, and the order of the items changes nothing. Three friends picked for a team are the same team in any order, so the 6 photo orders of the same three friends collapse into 1 team.

When Does Order Matter?

Order matters when swapping two items changes the result, and it does not matter when the result stays the same. A PIN of 1-2-3-4 is not the PIN 4-3-2-1, so a PIN is a permutation, and a team of Ali, Ben and Cara is the same team as Cara, Ben and Ali, so a team is a combination.

How to Use the Combination and Permutation Calculator?

Using a permutations and combinations calculator takes two numbers and one decision, and the Combination and Permutation Calculator on CalcSolver asks for n and r and shows both answers at once.

Enter the Total Number of Items (n)

n is the size of the whole set, and it is the first number you type. The tool’s n box starts at 5, and a negative n is refused with the message “Error: n cannot be negative.”

Enter the Number of Items to Select (r)

r is how many items you pick or arrange, and it is the second number you type. The tool’s r box starts at 2, and r must sit between 0 and n, or the tool answers “Error: r must be between 0 and n.” A negative r is refused with “Error: r cannot be negative.”

Choose Whether Order Matters

The tool has no order switch, and that is the honest part: it works out both answers from the same n and r, and you read the one your question asks for. If order matters, read the nPr line, and if it does not, read the nCr line.

Select Whether Repetition Is Allowed

The tool has no repetition switch either, and it always works with the no-repetition formulas, which is the part most people miss. A PIN can repeat a digit, but a committee cannot pick the same person twice, so repetition is a question you answer before you read the tool, and the repetition section below works the repeated cases by hand.

View Your Results and Step-by-Step Solution

The result line reads nCr(5,2) = 10 | nPr(5,2) = 20 for the tool’s own defaults, and the steps panel shows each formula with the numbers in it. I check the steps panel against the factorials in my head, because the nCr line divides by r! and the nPr line does not, and that one division is the whole difference between the two answers.

Permutation and Combination Formulas

The two formulas share one ingredient, the factorial, and the Combination and Permutation Calculator on CalcSolver works both of them out from the same n and r. The Combination is the selection, the permutation is the arrangement, and the only difference between their formulas is one division.

Permutation Formula: nPr

The permutation formula is nPr = n! ÷ (n − r)!, and it counts the orders. For my five friends and three photo spots, n is 5 and r is 3, so nPr = 5! ÷ 2! = 120 ÷ 2 = 60, and the 60 is the number the tool’s nPr line shows.

Combination Formula: nCr

The combination formula is nCr = n! ÷ (r! × (n − r)!), and it counts the groups. For the same five friends and a three-person team, nCr = 5! ÷ (3! × 2!) = 120 ÷ (6 × 2) = 120 ÷ 12 = 10, and the 10 is the number the tool’s nCr line shows.

How Factorials Are Used in Both Formulas?

A factorial multiplies a number by every whole number below it, so 5! = 5 × 4 × 3 × 2 × 1 = 120, and 3! = 6 and 2! = 2. The Combination and Permutation Calculator works both formulas from these factorials. If you want the factorials without the division, the Factorial Calculator works them out one at a time.

Permutations vs. Combinations: What’s the Difference?

The difference between a permutation and a combination is one question, and the Combination and Permutation Calculator on CalcSolver answers both, so you never need to choose before you type.

How Permutations Work When Order Matters?

For three photo spots from five friends, the first spot has 5 choices, the second has 4, and the third has 3, and 5 × 4 × 3 = 60, which is the same 60 the formula gives.

How Combinations Work When Order Does Not Matter?

A combination picks the group and then ignores the orders, and it divides the permutation by the orders of the group. For the same three friends, the permutation is 60 and the group of 3 has 3! = 6 orders, so 60 ÷ 6 = 10, which is the same 10 the formula gives.

Simple Example Comparing Both Methods

Take 5 friends and 3 spots, and the Combination and Permutation Calculator shows both numbers at once: 10 teams and 60 photo orders. One question, two answers, and the ratio between them is always r!.

How to Calculate Permutations and Combinations by Hand?

Working a permutation or a combination by hand takes the same three moves as the tool, and the Combination and Permutation Calculator on CalcSolver is the place I confirm the answer.

Step-by-Step Permutation Example

Take the photo line-up: 5 friends, 3 spots. A permutation formula calculator starts with 5! = 120 and divides by (5 − 3)! = 2! = 2, so 120 ÷ 2 = 60, and the answer is 60 orders. I check the answer by counting the spots instead: 5 choices for the first, 4 for the second, 3 for the third, and 5 × 4 × 3 = 60, so the two routes agree.

Step-by-Step Combination Example

Take the team: 5 friends, 3 places, and the Combination and Permutation Calculator confirms the answer in one click. Start with 5! = 120, divide by 3! = 6 for the orders and by 2! = 2 for the ones left out, so 120 ÷ (6 × 2) = 120 ÷ 12 = 10, and the answer is 10 teams.

The Math Behind the Calculations

A permutation counts every order, so it divides n! by (n − r)! only, and a combination counts each group once, so it divides by r! as well. That is the whole of the math: the permutation is the falling product n × (n − 1) × … × (n − r + 1), and the combination is that product divided by r!.

Visual Explanation of Permutations and Combinations

Picture five friends standing in a row, and pick three of them. Draw the pick as a circle around three friends, and draw the arrangement as a line of three spots, and the circle is the combination while the line is the permutation.

Combination and Permutation Calculator showing five people tokens, three glowing orange, beside a calculator on dark navy
Three picked from five: one team, but sixty ways to line them up for a photo.

Understanding Advanced Selection Rules

Sometimes the count comes with a condition, and the Combination and Permutation Calculator on CalcSolver has no buttons for these rules, so they are worked by hand in this section.

The “Has” Rule: Including Required Items

The “has” rule says certain items must be included in every selection. Take six items, a, b, c, d, e and f, and pick three: there are C(6,3) = 20 groups in all, and the has rule keeps only the groups that hold the named items.

Example: Has 1, a, b, c

“Has 1, a, b, c” means every result must hold at least one of a, b and c. Out of the 20 groups, only one fails: {d, e, f}, the group with none of the three, so 19 groups pass.

Example: Has 2, a, b, c

“Has 2, a, b, c” means every result must hold at least two of a, b and c. The groups that pass are the 9 with exactly two of the three, plus the 1 with all three, so 10 groups pass: abc, abd, abe, abf, acd, ace, acf, bcd, bce and bcf.

The “No” Rule: Excluding Specific Items

The “no” rule bans items from every selection. Take five items, a, b, c, d and e, and pick three: there are C(5,3) = 10 groups in all, and the no rule throws out the groups that hold the banned items together.

Example: n = 5, r = 3, Order = No, Replace = No

This is the plain case the other two examples start from: n is 5, r is 3, order does not matter, and no item repeats.

Example: No 2, a, b, c

“No 2, a, b, c” bans every group that holds at least two of a, b and c. Seven groups vanish: abc, abd, abe, acd, ace, bcd and bce, and only three survive: ade, bde and cde.

Example: No 3, a, b, c

“No 3, a, b, c” bans only the group that holds all three named items. One group vanishes, {a, b, c}, and nine survive, so the rule is gentle, and it changes the count from 10 to 9.

The “Pattern” Rule: Following a Required Arrangement

The “pattern” rule fixes the positions, and two wildcards do the work: ? means any single item, and the star means any number of items, including none. The Combination and Permutation Calculator cannot follow a pattern, so the examples below are worked by hand.

Example: Pattern ?, c, *, f

“Pattern ?, c, *, f” means any item, then c, then anything, then f. The group {a, c, d, f} passes, and {b, c, f} passes too, because the star can be empty. The group {c, d, e, f} fails, because its second item is d, not c, and the pattern needs c in the second place.

Example: Arranging Alex, Betty, Carol, and John with John After Alex

Four people, Alex, Betty, Carol and John, can be lined up in 4! = 24 orders, and John stands after Alex in exactly half of them, so the answer is 12. The pattern is anything, then Alex, then anything, then John.

Permutations and Combinations With and Without Repetition

Repetition is the question the tool never asks, and the Combination and Permutation Calculator on CalcSolver always works with the no-repetition formulas, so the repeated cases below are worked by hand.

Permutations With Repetition

A permutation with repetition lets every spot take any item again, so the count is n^r. The Combination and Permutation Calculator does not work this case, because the tool only works the no-repetition formulas, so the PIN below is worked by hand. A 4-digit PIN from the ten digits has 10^4 = 10,000 possibilities, because each of the four spots has 10 choices. If you want the power without the counting, the Exponent Calculator works out 10^4 in one step.

Permutations Without Repetition

A permutation without repetition lets each item be used once, so the count is the falling product n × (n − 1) × … × (n − r + 1), which is nPr. A 3-digit code from the ten digits, with no digit repeated, has 10 × 9 × 8 = 720 possibilities, and the tool’s nPr line shows the same 720 for n = 10 and r = 3.

Combinations With Repetition

A combination with repetition lets the same item be picked more than once, and the count is C(n + r − 1, r). Three scoops from five flavours give C(5 + 3 − 1, 3) = C(7,3) = 35 possible orders of scoops, because the scoops can repeat and their order does not matter. A combination calculator with repetition uses this formula, and the tool’s nCr line does not, so this one is worked by hand.

Combinations Without Repetition

A combination without repetition picks each item at most once, and the count is C(n, r), which is the number the Combination and Permutation Calculator shows on its nCr line. Five friends and a three-person team give C(5,3) = 10, and the tool shows the same 10 for n = 5 and r = 3.

Combinations Generator: Create Possible Selections

A combinations generator lists every selection instead of counting them, and the Combination and Permutation Calculator on CalcSolver has no generator button, so the list below is worked by hand. A combination calculator counts the groups, and a generator writes them all out, and the list is only useful when the count is small.

Generate Different Combinations From a Set of Items

Take the five friends again, a, b, c, d and e, and their ten teams are: abc, abd, abe, acd, ace, ade, bcd, bce, bde and cde. The Combination and Permutation Calculator counts them as 10, and the list above is the ten it counts.

Understand and Review the Generated Results

I check the list against the count before I trust it: ten teams on the page and C(5,3) = 10 on the tool, so the list and the number agree.

Frequently Asked Questions

What is the difference between a permutation and a combination?

A permutation counts the orders and a combination counts the groups, and the swap test tells them apart: if swapping two items changes the answer, it is a permutation. A permutations and combinations calculator shows both numbers from the same n and r, so you can read the one your question asks for.

How do I calculate nPr?

Use the formula nPr = n! ÷ (n − r)!, or type n and r into a permutation formula calculator and read the nPr line.

How do I calculate nCr?

Use the formula nCr = n! ÷ (r! × (n − r)!), or type n and r into the Combination and Permutation Calculator and read the nCr line. For n = 5 and r = 3, nCr = 120 ÷ 12 = 10, because 5! = 120 and 3! × 2! = 12.

Does order matter in combinations?

No, order never matters in a combination, and that is the definition: a team is the same team in any order. The Combination and Permutation Calculator shows nCr beside nPr, and the nCr line is the one where order is ignored.

Can a combination have repeated items?

Yes, when repetition is allowed, and the formula is C(n + r − 1, r) instead of C(n, r).

What is the difference between permutation with and without repetition?

With repetition, every spot can take any item again, so the count is n^r, and a 4-digit PIN has 10^4 = 10,000 possibilities. Without repetition, each item is used once, so the count is the falling product, and a 3-digit code with no repeat has 10 × 9 × 8 = 720 possibilities.

What does n and r mean in permutation and combination formulas?

n is the size of the whole set and r is how many items you pick or arrange. For a deck of cards n is 52, for a 5-card hand r is 5, and the formulas need both numbers before they can count anything.

Can I use this as a permutation formula calculator?

Yes, type n and r into the tool on CalcSolver and read the nPr line, which uses nPr = n! ÷ (n − r)! and shows the steps.

How many combinations can be made from a given number of items?

It depends on n and r, so type both into a combination calculator and read the nCr line.

Explore Related Math Calculators

The Combination and Permutation Calculator on CalcSolver sits beside three calculators I open most often, and a permutations and combinations calculator is only one of them. The Factorial Calculator works out n! one number at a time, the Exponent Calculator works out the powers that repetition needs, and for a number as big as 2,598,960, the Scientific Notation Calculator writes it as 2.59896 × 10^6.