What this calculator does
Find out how many different groups you can pick from a set when the order doesn't matter. That kind of selection is called a combination: only who or what is in the group counts. A poker hand, a pizza with three toppings and a committee of four people are all combinations. The hand ace-king-queen-jack-ten is the same hand however the cards were dealt.
Counting combinations is the first step in many probability questions. That's because the chance of one particular selection is often 1 divided by the number of possible selections.
This calculator counts the ways to choose r items from n. It works without repetition, where each item can be picked only once. That's written nCr or C(n, r). It also works with repetition, where an item can be picked again and again, like scoops of the same ice-cream flavor. The answer uses exact whole-number arithmetic. So even results with thousands of digits are right to the last digit.
Where it's used
Why this math matters outside the classroom:
- Lottery odds. A lottery drawing 6 numbers from 49 has C(49, 6) = 13,983,816 possible tickets.
- Pizza toppings. A pizzeria offering 10 toppings can make C(10, 3) = 120 different three-topping pizzas.
- Committees. A club of 12 members can form C(12, 4) = 495 different four-person committees.
- Card hands. A 52-card deck deals C(52, 5) = 2,598,960 different five-card hands.
- Ice cream cups. Choosing 3 scoops from 5 flavors with repeats allowed gives C(7, 3) = 35 different cups.
Grade level and standards: Grades 11–12; Common Core State Standards for Mathematics HSS.CP.B.9. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Choose Without repetition if each item can be picked at most once. Choose With repetition if the same item can be picked more than once.
- Enter n, the number of different items you can choose from.
- Enter r, the number of items in each selection.
- Read the count and the factorial working. Large answers appear in scientific notation (a short form for huge numbers), with the exact digits listed underneath.
What the inputs mean
- Repetition
- Without repetition is like drawing names from a hat. With repetition is like choosing from an endless supply of each kind.
- Number of items to choose from (n)
- The size of the pool: 52 for a deck of cards, or the number of flavors on a menu. Whole numbers from 0 to 10,000.
- Number of items chosen (r)
- How many items each selection holds. Without repetition, r can't be more than n. With repetition, it can.
Formula and method
C(n, r) = n! ÷ (r! × (n − r)!) With repetition: C(n + r − 1, r) = (n + r − 1)! ÷ (r! × (n − 1)!)
Here n is the number of items to choose from and r is how many you pick. C(n, r) is the number of combinations. The ! sign means factorial: n! is n × (n − 1) × … × 2 × 1. It's the number of ways to put n items in order. By agreement, 0! counts as 1.
Dividing n! by (n − r)! counts the ordered selections of r items. Dividing again by r! removes the r! different orders of each selection, because order doesn't matter in a combination.
In practice, most of the factorial cancels out. C(52, 5) becomes (52 × 51 × 50 × 49 × 48) ÷ 5!, which is what the working shows.
Combinations with repetition use a trick called 'stars and bars'. Picture a selection of r items from n kinds as r stars split up by n − 1 bars. So the count is the number of ways to place r stars among n + r − 1 spots.
Worked example
How many different five-card hands can be dealt from a standard 52-card deck?
- Write the formula: C(52, 5) = 52! ÷ (5! × 47!).
- Cancel 47!, leaving (52 × 51 × 50 × 49 × 48) ÷ 5!.
- Multiply out: 311,875,200 ÷ 120.
- Divide: 2,598,960.
Result: There are 2,598,960 possible five-card hands, so any one specific hand has a probability of 1 in 2,598,960. With repetition instead, choosing 3 scoops from 5 flavors gives C(7, 3) = 35 possible bowls.
Understanding the result
The count is the number of different groups. If every group is equally likely, the chance of any one group is 1 divided by the count. The chance of a group with some feature is the number of such groups divided by the count.
C(n, r) equals C(n, n − r). Choosing 5 cards to keep is the same as choosing 47 to leave behind. That's why the working cancels whichever factorial on the bottom is larger.
Assumptions and limitations
- The n items are all different from one another. Identical items, such as repeated letters in a word, need a different count.
- Order doesn't matter. If it does, use the permutation calculator instead.
- Without repetition, each item can appear at most once in a selection.
- n and r are limited to 10,000 to keep the exact calculation fast. Results with more than 1,000 digits show how many digits there are, rather than every digit.
- The calculator counts selections; it doesn't list them.
- It doesn't handle selections with conditions, such as 'at least two from group X'. Those need several combinations added together.
Frequently asked questions
What is the difference between a combination and a permutation?
A permutation counts arrangements where order matters, so first-second-third is different from third-second-first. A combination counts groups where order doesn't matter. For the same n and r, the number of permutations is r! times the number of combinations.
Why is C(n, 0) equal to 1?
There's exactly one way to choose nothing: the empty selection. The formula agrees, because n! ÷ (0! × n!) = 1 when 0! counts as 1.
When should I use combinations with repetition?
Use it when you choose from kinds rather than single objects, and can take several of the same kind. Examples are 12 donuts from 6 varieties, or 3 scoops from 5 flavors. The order still doesn't matter: two chocolate and one vanilla is one selection however it's served.
Why are large results shown in scientific notation?
Counts grow very quickly: C(100, 50) already has 30 digits. Scientific notation, such as 1.008913445 × 10^29, shows the size at a glance. The exact value is always worked out with whole-number arithmetic and listed digit by digit beneath it, up to 1,000 digits.
How this calculator is checked
Method: Standard binomial coefficient n!/(r!(n−r)!) and the stars-and-bars count C(n+r−1, r) for multisets. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Combination Calculator on your own website or blog for free. Paste this code where you want it to appear: