Permutation and Combination Calculator
- Permutations count arrangements where order matters: P(10, 3) = 10! ÷ (10 − 3)! = 720. Combinations ignore order, so each unordered group is counted 3! = 6 times in the permutation count: C(10, 3) = 720 ÷ 6 = 120.
- With repetition allowed, every slot is a fresh choice from all 10: permutations become 10^3 = 1,000, and combinations with repetition use the stars-and-bars count C(10 + 3 − 1, 3) = 220.
- Rule of thumb: podium finishes, passwords and seating plans are permutations; lottery tickets, committees and pizza toppings are combinations. If swapping two picks produces a different outcome, order matters.
A permutation and combination calculator tells you how many ways you can choose r items from a set of n items. Permutations count arrangements where order matters, using the formula P(n, r) = n! / (n-r)!, so P(8, 3) = 336 is the number of ways to award gold, silver and bronze among 8 runners, and with repetition that climbs to n^r (8^3 = 512). Combinations count selections where order is ignored, using C(n, r) = n! / (r! (n-r)!), so C(10, 3) = 120 gives the number of 3-person committees from 10 people, and C(52, 5) = 2,598,960 is the number of five-card poker hands, the denominator behind every poker probability. The rule of thumb: if swapping two picks produces a different outcome, order matters and it is a permutation; lottery tickets and committees are combinations, podiums and passwords are permutations.
These formulas are the accepted standard for counting selections and arrangements because they follow directly from the fundamental counting principle, multiplying successive choices to exhaust every possibility without double-counting. The same logic extends to combinations with repetition via stars and bars: C(n+r-1, r), e.g. C(12, 3) = 220 for n=10, r=3. This page shows the formula, step-by-step workings, worked examples and sources so you can verify each result by hand.
Worked examples
Choosing a committee of 3 from 10 people
C(10, 3) = 120 — order does not matter in a committee. (10 items · 3 items · Combinations — order ignored, no repetition)
| Combinations (order ignored, no repetition) | 120 |
| Permutations (order matters, no repetition) | 720 |
| Permutations with repetition | 1,000 |
| Combinations with repetition | 220 |
| 10! (factorial of n) | 3,628,800 |
Five-card poker hands from a 52-card deck
C(52, 5) = 2,598,960 possible hands — the denominator behind every poker probability. (52 items · 5 items · Combinations — order ignored, no repetition)
| Combinations (order ignored, no repetition) | 2,598,960 |
| Permutations (order matters, no repetition) | 311,875,200 |
| Permutations with repetition | 380,204,032 |
| Combinations with repetition | 3,819,816 |
| 52! (factorial of n) | 8.0658e+67 |
Gold, silver and bronze from 8 runners
P(8, 3) = 336 podium orders — swap two finishers and it is a different result, so order matters. (8 items · 3 items · Permutations — order matters, no repetition)
| Permutations (order matters, no repetition) | 336 |
| Combinations (order ignored, no repetition) | 56 |
| Permutations with repetition | 512 |
| Combinations with repetition | 120 |
| 8! (factorial of n) | 40,320 |
Permutation or combination? The one question that decides
The single question that settles every counting problem is this: does the order of your selections matter? If the answer is yes, you are dealing with permutations. If the answer is no, you are dealing with combinations. A reliable permutation and combination calculator will ask you to make this choice before anything else, because the formulas diverge from that point on. The underlying math is straightforward: permutations use P(n, r) = n! / (n-r)!, while combinations use C(n, r) = n! / (r! (n-r)!). The extra r! in the denominator of the combination formula exists precisely to erase the different orderings that a permutation would otherwise count separately.
A practical way to test yourself is the swap test. Take any two items in your selection and swap their positions. If the swap produces a different outcome, order matters and you have a permutation. If the swap changes nothing, order is irrelevant and you have a combination. Picture a race with 8 runners where gold, silver, and bronze are awarded. Runner A winning gold, runner B winning silver, and runner C winning bronze is not the same as runner C winning gold, runner B winning silver, and runner A winning bronze. The swap changes the result, so this is a permutation. The verified count is P(8, 3) = 336 — there are 336 ways to distribute those three medals among 8 runners.
Now picture a 3-person committee chosen from 10 people. A committee of Alice, Bob, and Carlos is the same committee regardless of whose name is listed first. Swapping two members around the table does not create a new committee, so order is irrelevant. This is a combination, and the verified count is C(10, 3) = 120. The same logic governs card games. A five-card poker hand does not change depending on the order in which the cards were dealt, which is why combinations apply. The verified count is C(52, 5) = 2,598,960 — the number of possible five-card poker hands and the denominator behind every poker probability calculation.
Some situations allow repetition, which changes the math. When order matters and items can repeat, such as a 3-character password drawn from 8 possible characters, the count is n^r, so 8^3 = 512. When order does not matter and repetition is allowed, combinations use a stars-and-bars formula: C(n+r-1, r). For example, choosing 3 items from a set of 10 with repetition gives C(12, 3) = 220. As a rule of thumb, lottery tickets and committees are combinations, while podiums and passwords are permutations.
The four formulas, worked
These four formulas cover almost every counting problem you will meet. Use this section as a reference alongside any permutation and combination calculator: each row below pairs the formula with a verified result so you can check your own work.
Permutations apply when order matters. The formula is P(n, r) = n! / (n-r)!. For example, P(8, 3) = 336, the number of ways to award gold, silver and bronze among 8 runners. Combinations apply when order is ignored: C(n, r) = n! / (r! (n-r)!). Here, C(10, 3) = 120, the number of 3-person committees from 10 people. The same combination formula also gives C(52, 5) = 2,598,960, the number of five-card poker hands and the denominator behind every poker probability.
When repetition is allowed, the counts grow. Permutations with repetition become n^r, so 8^3 = 512. Combinations with repetition use the stars-and-bars formula C(n+r-1, r); for n=10 and r=3, that gives C(12, 3) = 220.
A simple rule of thumb keeps these straight: if swapping two picks produces a different outcome, order matters and it is a permutation. Lottery tickets and committees are combinations; podiums and passwords are permutations.
| Count | Formula | Example | Verified value | Meaning |
|---|---|---|---|---|
| Permutation (order matters) | P(n, r) = n! / (n-r)! | P(8, 3) | 336 | Ways to award gold, silver and bronze among 8 runners |
| Combination (order ignored) | C(n, r) = n! / (r! (n-r)!) | C(10, 3) | 120 | Number of 3-person committees from 10 people |
| Combination (order ignored) | C(n, r) = n! / (r! (n-r)!) | C(52, 5) | 2,598,960 | Number of five-card poker hands, the denominator behind every poker probability |
| Permutation with repetition | n^r | 8^3 | 512 | Permutations when repetition is allowed |
| Combination with repetition | C(n+r-1, r) | C(12, 3) for n=10, r=3 | 220 | Combinations with repetition using stars and bars |
The poker-hand number: 2,598,960
Ask a permutation and combination calculator for C(52, 5) and the answer comes back 2,598,960. That single number is the total count of five-card poker hands that can be dealt from a standard 52-card deck. It is also the denominator behind every poker probability you will ever encounter, from the chance of a pair to the odds of a royal flush.
The math follows the combinations formula because order does not matter in a poker hand. The formula is C(n, r) = n! / (r! (n-r)!). Plugging in the deck size and hand size gives C(52, 5) = 52! / (5! × 47!). Working through the arithmetic step by step: 52 × 51 × 50 × 49 × 48 divided by 5 × 4 × 3 × 2 × 1. The numerator is 311,875,200. The denominator is 120. Dividing those gives 2,598,960.
Why combinations rather than permutations? The rule of thumb is simple: if swapping two picks produces a different outcome, order matters and it is a permutation. In poker, a hand containing the ace of spades, king of hearts, queen of diamonds, jack of clubs, and ten of hearts is the same hand no matter what order the cards arrive in. Because the order of the five cards is irrelevant, every unique set of five cards is counted once, not multiple times for each possible arrangement.
This is why 2,598,960 sits at the foundation of poker math. Want the probability of being dealt four of a kind? Count the specific hands that qualify, then divide by 2,598,960. Looking for the chance of a flush? Do the same. The numerator changes for each hand rank, but the denominator stays fixed at 2,598,960 for any standard five-card draw from a 52-card deck. This number is what makes it possible to compare the rarity of one hand against another on the same scale.
How to use this permutation and combination calculator
To use this permutation and combination calculator, start by entering your two values: n, the total number of items available, and r, the number of items you are selecting at a time. For example, if 8 runners compete and you want to know how many ways gold, silver, and bronze can be awarded, set n to 8 and r to 3. The calculator will then compute P(8, 3) = 336, the number of ordered arrangements. If you were instead choosing a 3-person committee from 10 people, you would set n to 10 and r to 3, and the calculator would return C(10, 3) = 120, because the order of selection does not change the committee.
Next, pick the correct mode. The rule of thumb is simple: if swapping two picks produces a different outcome, order matters and you have a permutation. Lottery tickets and committees are combinations because the arrangement of the chosen items is irrelevant. Podiums and passwords are permutations because changing the sequence changes the result. The underlying formulas are P(n, r) = n! / (n-r)! for permutations, where order matters, and C(n, r) = n! / (r! (n-r)!) for combinations, where order is ignored.
If your scenario allows the same item to be chosen more than once, select the repetition mode. With repetition, permutations are calculated as n^r, so P(8, 3) with repetition equals 8^3 = 512, which might apply to a 3-character password drawn from 8 possible characters. Combinations with repetition use the stars and bars method, calculated as C(n+r-1, r). For n=10 and r=3, that gives C(12, 3) = 220, which could represent the number of ways to select 3 items from 10 types when duplicates are allowed.
When you are unsure which result applies to your problem, read all four outputs the calculator provides: permutations without repetition, combinations without repetition, permutations with repetition, and combinations with repetition. Comparing the four side by side helps you confirm which one matches your scenario. A clear example is a standard deck of cards: C(52, 5) = 2,598,960 is the number of five-card poker hands, the denominator behind every poker probability. Because the hand is the same regardless of the order in which the cards are dealt, the combination result is the one that applies, and seeing the larger permutation value alongside it confirms why the distinction matters.
- Enter n as the total pool size and r as the number being selected.
- Choose permutation mode when order matters; choose combination mode when it does not.
- Use repetition mode when the same item can be selected more than once.
- If unsure which applies, compare all four outputs and match the result to your scenario.
Repetition changes everything
The formulas P(n, r) = n! / (n-r)! and C(n, r) = n! / (r! (n-r)!) assume each item can be selected only once. Real life does not always work that way. A PIN code can reuse the same digit, a license plate can repeat letters, and a lottery machine returns each ball before the next draw. Once repetition enters the picture, the standard formulas no longer apply, and a capable permutation and combination calculator must account for the distinction.
Consider passwords and podiums. Awarding gold, silver and bronze among 8 runners is a permutation without repetition: P(8, 3) = 336, because no runner can place twice and order defines the medal. If instead each of 3 judges independently ranks any of the 8 runners, repetition is allowed and the count becomes 8^3 = 512. The same jump occurs with PIN codes and license plates: each position is an independent choice from the same pool, so the total is n^r, not n! divided by (n-r)!.
Combinations with repetition behave differently still. Picture a bakery tray with 10 types of donut and a box that holds 3. You may select the same type more than once, and the order in the box is irrelevant. The stars-and-bars method handles this by converting the problem into a count of dividers among selections: C(n+r-1, r). For n=10 and r=3, that gives C(12, 3) = 220. The intuition is that you are choosing gaps between identical items, not the items themselves.
A reliable rule of thumb: if swapping two picks produces a different outcome, order matters and it is a permutation; if swapping changes nothing, it is a combination. Lottery tickets and committees are combinations, podiums and passwords are permutations. Verified examples anchor the idea: C(10, 3) = 120 counts 3-person committees from 10 people, C(52, 5) = 2,598,960 is the number of five-card poker hands behind every poker probability, and P(8, 3) = 336 counts the ways to award gold, silver and bronze among 8 runners. The committee and poker examples ignore order; the medal podium does not.
- Permutations without repetition: P(n, r) = n! / (n-r)! — example P(8, 3) = 336.
- Permutations with repetition: n^r — example 8^3 = 512 for independent picks from 8 options.
- Combinations without repetition: C(n, r) = n! / (r! (n-r)!) — example C(10, 3) = 120.
- Combinations with repetition: C(n+r-1, r) — example C(12, 3) = 220 for n=10, r=3.
Common traps
Three mistakes trip up most students and professionals when they reach for a permutation and combination calculator. The first and most common trap is mistaking a permutation problem for a combination, or vice versa. The rule of thumb is simple: if swapping two picks produces a different outcome, order matters and it is a permutation. Lottery tickets and committees are combinations because the order of selection does not change the result. Podiums and passwords are permutations because position changes everything. Awarding gold, silver and bronze among 8 runners is a permutation problem: P(8, 3) = 336. Forming a 3-person committee from 10 people is a combination problem: C(10, 3) = 120. Read the question carefully before you plug in numbers, because using the wrong formula gives a result that looks correct but answers the wrong question.
The second trap involves identical items and double-counting. When some objects in a set are indistinguishable, treating them as if they are all different inflates your count. A standard permutation formula assumes every item is unique. If you are arranging letters in a word with repeated characters, you must divide by the factorial of each repeated group to remove the duplicates. The same logic applies to any arrangement problem with identical objects. Failing to account for identical items is one of the fastest ways to get a wrong answer on an exam question.
The third trap is circular arrangements. When items sit in a row, a standard permutation works. When items sit around a circle, the count shrinks because rotating the circle does not create a new arrangement. For n distinct items around a circle, the number of distinct arrangements is (n-1)!, not n!. Many test questions include circular seating to catch students who apply the linear formula without thinking.
A related pitfall involves repetition. When items can be selected more than once, the formulas change. Permutations with repetition use n^r, so selecting 3 items from 10 with repeats allowed gives 10^3 = 1,000. Combinations with repetition use stars and bars: C(n+r-1, r). For n=10 and r=3, that gives C(12, 3) = 220. Always check whether the problem allows the same item to be chosen more than once before you start calculating.
- Order matters (permutation): podiums, passwords, ranked positions — use P(n, r) = n! / (n-r)!
- Order ignored (combination): committees, lottery tickets, poker hands — use C(n, r) = n! / (r!(n-r)!)
- Identical items: divide by factorials of repeated groups to avoid double-counting
- Circular arrangements: use (n-1)!, not n!
- Repetition allowed: permutations become n^r; combinations become C(n+r-1, r)
FAQs
What is the difference between permutations and combinations?
Permutations count order, while combinations ignore it. For example, P(8, 3) = 336 podiums because who finishes first, second, or third matters. But C(10, 3) = 120 committees because the order of selection does not matter — only who is on the committee.
How many 5-card hands are in a 52-card deck?
There are C(52, 5) = 2,598,960 possible 5-card hands. Because the order of the cards in your hand does not matter, this is a combination, not a permutation.
What is the formula for combinations?
The formula is C(n, r) = n! / (r! (n-r)!). Here n is the total number of items and r is how many you choose. For 10 choose 3, that is 120.
How do permutations with repetition work?
When repetition is allowed, every slot is a fresh choice, so the count is n^r. For example, 3 slots from 8 symbols give 8^3 = 512 possible arrangements.
What are combinations with repetition?
Combinations with repetition use the stars and bars method: C(n+r-1, r). For example, choosing 3 from 10 types with repeats allowed gives C(12, 3) = 220.
Is a lottery a permutation or a combination?
A lottery is a combination — the order the balls are drawn does not change the ticket. This is just like C(52, 5) for cards, where the order of selection does not matter.