Combination Calculator

Enter n and r to get an exact combination count. Choose whether repetition is allowed, then review the result and supporting details.

Results are calculated automatically as you enter data.

Formula and steps
Combination nCr

▼ See explanations and tips below ▼

What Are Combinations?

Combinations are a way to count selections when the order of the selected items does not matter. If you choose 3 students from a class to form a committee, the group Alice, Ben, and Carlos is the same committee no matter which name you say first. That is a combination problem.

The main question is: how many different groups of size \(r\) can be chosen from \(n\) available items?

For example, choosing 2 toppings from 5 topping options is not the same kind of question as arranging 2 toppings in first-and-second order. A combination only cares which toppings are included. It does not care about the order in which they are named, chosen, or displayed.

Combinations are part of combinatorics, the branch of mathematics concerned with counting structured possibilities. They are useful because many real-world questions are too large to answer by listing every option one by one.


Why Combinations Matter

Combinations help turn a counting problem into a clear formula. That matters whenever the list of possibilities grows quickly.

They are commonly used for:

  • forming teams, committees, panels, or groups;
  • counting lottery tickets, card hands, or raffle outcomes;
  • finding possible sets of ingredients, flavors, colors, or features;
  • comparing unordered selections with ordered arrangements;
  • building probability calculations where each possible group is equally likely;
  • understanding binomial coefficients in algebra and Pascal's triangle.

The key benefit is that combinations avoid overcounting. If order does not matter, counting every possible order gives a number that is too large. The combination formula corrects that overcount.


Key Terms to Know

  • \(n\): The number of available items or item types.
  • \(r\): The number of items selected.
  • Combination: A selection where order is ignored.
  • Permutation: An arrangement where order matters.
  • Factorial: The product of positive whole numbers down to 1. For example, \(5! = 5 \times 4 \times 3 \times 2 \times 1\). By convention, \(0! = 1\).
  • Binomial coefficient: The number \(\binom{n}{r}\), read as “\(n\) choose \(r\).” It counts combinations of \(r\) items from \(n\) items.
  • Repetition: The option that allows the same item type to be chosen more than once.
  • Replacement: Another way to describe repetition: after choosing an item, it is still available to be chosen again.
  • Multiset: An unordered collection that can contain repeated items, such as {vanilla, vanilla, chocolate}.
  • Pascal's triangle: A triangular arrangement of binomial coefficients. The entry in row \(n\) and position \(r\) corresponds to \(\binom{n}{r}\) when rows and positions are counted from 0.

How Combinations Work

A standard combination counts unordered selections without repetition. “Without repetition” means each available item can be selected at most once.

The formula is:

$$ \binom{n}{r} = \frac{n!}{r!(n-r)!} $$

where:

  • \(n\) is the number of available items;
  • \(r\) is the number of selected items;
  • \(!\) means factorial;
  • \(\binom{n}{r}\) is the number of unordered selections.

The reason for the formula is closely related to permutations. If order mattered, the number of ways to choose and arrange \(r\) items from \(n\) items would be:

$$ P(n,r) = \frac{n!}{(n-r)!} $$

But each unordered group of \(r\) items can be arranged in \(r!\) different orders. Since combinations do not count those orders separately, divide by \(r!\):

$$ \binom{n}{r} = \frac{P(n,r)}{r!} = \frac{n!}{r!(n-r)!} $$

This also explains why a combination count is usually much smaller than the matching permutation count.

Combinations also have a useful symmetry:

$$ \binom{n}{r} = \binom{n}{n-r} $$

Choosing 3 people to be on a committee from 10 people is equivalent to choosing the 7 people who are not on the committee. Both choices identify the same outcome from opposite directions.


How Combinations With Repetition Work

When repetition is allowed, the selection can include the same item type more than once. This is the right model for questions such as choosing 4 scoops of ice cream from 6 flavors when repeated flavors are allowed and the order of scoops does not matter.

A selection with repetition is often counted as a multiset. The formula is:

$$ \binom{n+r-1}{r} = \frac{(n+r-1)!}{r!(n-1)!} $$

where:

  • \(n\) is the number of available item types;
  • \(r\) is the number of selected items;
  • \(n+r-1\) is the adjusted total used by the stars-and-bars method.

The stars-and-bars idea represents selected items as “stars” and the boundaries between item types as “bars.” For \(r\) selected items and \(n\) item types, there are \(r\) stars and \(n-1\) bars, for a total of \(n+r-1\) positions. Choosing which \(r\) positions hold the stars gives the number of possible multisets.

This formula assumes there is at least one available item type when selecting a positive number of items. The special empty-selection case is handled separately: choosing 0 items from 0 available items has exactly one outcome, the empty selection.


Examples of Combinations in Practice

Example 1: Choosing a Committee

Suppose 8 students are eligible for a 3-person committee. The order of the committee members does not matter, and no student can be chosen twice.

Use the standard combination formula:

$$ \binom{8}{3} = \frac{8!}{3!(8-3)!} $$
$$ \binom{8}{3} = \frac{8!}{3!5!} $$

Cancel the \(5!\) part of \(8!\):

$$ \binom{8}{3} = \frac{8 \times 7 \times 6}{3 \times 2 \times 1} $$
$$ \binom{8}{3} = \frac{336}{6} = 56 $$

There are 56 possible 3-person committees.


Example 2: Comparing Combinations and Permutations

Using the same 8 students and 3 positions, suppose the group must have a president, vice president, and treasurer. Now order or role assignment matters.

The permutation count is:

$$ P(8,3) = \frac{8!}{(8-3)!} $$
$$ P(8,3) = 8 \times 7 \times 6 = 336 $$

That is larger than 56 because each group of 3 students can be assigned to the 3 roles in \(3! = 6\) ways:

$$ 56 \times 6 = 336 $$

Use combinations for the committee as a group. Use permutations for role assignments, rankings, ordered lists, or sequences.


Example 3: Choosing With Repetition

Suppose an ice cream shop has 6 flavors, and you want a 4-scoop bowl. Repeated flavors are allowed, and the order of scoops does not matter.

Here, \(n = 6\) and \(r = 4\):

$$ \binom{n+r-1}{r} = \binom{6+4-1}{4} $$
$$ \binom{9}{4} = \frac{9!}{4!5!} $$
$$ \binom{9}{4} = \frac{9 \times 8 \times 7 \times 6}{4 \times 3 \times 2 \times 1} = 126 $$

There are 126 unordered 4-scoop choices when repeated flavors are allowed.


Example 4: The Empty Selection

Choosing 0 items is a valid counting case. From 12 available items, there is exactly one way to choose no items: choose nothing.

$$ \binom{12}{0} = 1 $$

The same convention gives:

$$ \binom{0}{0} = 1 $$

This does not mean there is one physical item. It means there is one possible selection: the empty selection.


How to Interpret the Result

The main result is an exact whole-number count of unordered selections under the chosen repetition setting.

If repetition is turned off, the result counts groups where each item can appear at most once. For example, if \(n = 10\) and \(r = 4\), the result counts 4-item subsets of a 10-item set.

If repetition is turned on, the result counts unordered selections where item types may repeat. For example, selecting {chocolate, chocolate, vanilla} is allowed and is different from {chocolate, vanilla, vanilla}. However, {chocolate, chocolate, vanilla} is not counted again just because the scoops are named in a different order.

A low result means there are relatively few possible groups. A high result means the number of possible groups is large, even if \(n\) and \(r\) look modest. Combination counts can grow very quickly.

The permutation comparison helps show the effect of ignoring order. When the permutation count is much larger than the combination count, it means many ordered arrangements collapse into the same unordered group.

The Pascal-row preview connects the result to binomial coefficients. In standard mode, the result corresponds to an entry in row \(n\) of Pascal's triangle. In repetition mode, it corresponds to an entry in row \(n+r-1\).

When a very large result is shortened on screen, it is still an exact integer result. The shortening is for readability, not mathematical rounding.


Common Mistakes and Misconceptions

Confusing combinations with permutations. A combination ignores order. A permutation counts order. If changing the order creates a new outcome, use a permutation-style count instead.

Using \(r > n\) when repetition is not allowed. Without repetition, you cannot choose more distinct items than the number available. Choosing 6 distinct books from 4 books is impossible.

Forgetting that repetition changes the formula. With repetition, \(\binom{n}{r}\) is no longer the right count. Use \(\binom{n+r-1}{r}\) when order is ignored and repeated item types are allowed.

Assuming repetition works with an empty set. If there are 0 available item types, you cannot choose a positive number of items. The only valid empty-set selection is choosing 0 items.

Reading the visual preview as a full list. A visual selection or Pascal-row display helps explain the count, but it does not list every possible combination.

Treating a shortened large number as rounded. A visually abbreviated result is still representing an exact integer. It is shortened only to make the display easier to read.


When to Use Combinations

Use combinations when the outcome is best described as a group, set, subset, hand, committee, collection, or unordered selection.

Common examples include:

  • choosing committee members from a larger group;
  • selecting cards for a poker hand;
  • counting possible lottery number sets when draw order does not matter;
  • choosing toppings when each topping can be used at most once;
  • choosing repeated flavors, colors, or item types when repetition is allowed;
  • counting possible multisets;
  • counting terms in binomial expansions;
  • building probability denominators for unordered outcomes.

Do not use a combination count when the result depends on rank, sequence, position, schedule order, password order, or role assignment. Those problems usually require permutations, the product principle, or another counting method.


Limitations and Things to Keep in Mind

Combination formulas count possibilities; they do not list the actual selections. If you need every group written out, a counting result is only the first step.

The inputs are counts, so they must be non-negative whole numbers. Decimals, negative numbers, fractions, comma-formatted numbers, and scientific notation are not meaningful for this calculator's input fields.

Each input is limited to the supported range of the calculator. Values greater than 500 are not accepted, even though combinatorics can define some larger counts in theory.

Without repetition, \(r\) cannot be greater than \(n\). With repetition, \(r\) can be greater than \(n\) only when \(n\) is positive.

The calculator gives exact integer counts and does not apply decimal rounding. Very large exact results may be abbreviated visually for readability.

The result is not automatically a probability. To turn a combination count into a probability, you also need a clearly defined random process, a sample space, and assumptions about which outcomes are equally likely.

The calculator does not handle weighted selections, custom item names, probabilities, or cases where some item types have limited quantities. For those situations, the counting model may need to be adjusted.


How to Use This Calculator

  1. Enter \(n\), the number of available items or item types.
  2. Enter \(r\), the number of items to select.
  3. Leave repetition unchecked for ordinary combinations without replacement.
  4. Turn repetition on when the same item type may be selected more than once.
  5. Read the exact combination count in the result area.
  6. Use the formula details to compare the combination result with the related permutation-style count.
  7. Use the Pascal-row or selection preview as a visual aid, not as a full list of all combinations.
  8. Use the graph download option if you want to save the visual preview.

Frequently Asked Questions

What is the difference between a combination and a permutation?

A combination counts selections where order does not matter. A permutation counts arrangements where order does matter. Choosing 3 people for a team is a combination, while assigning those 3 people to president, vice president, and treasurer is a permutation-style problem.


What does “with repetition” mean?

“With repetition” means the same item type can be selected more than once. For example, choosing 3 scoops from 5 flavors with repetition allows chocolate, chocolate, and vanilla. The order is still ignored unless the problem specifically says order matters.


Why does the repetition formula use \(n+r-1\)?

With repetition, the problem can be represented using \(r\) selected items and \(n-1\) dividers between item types. Together, that makes \(n+r-1\) positions. Choosing which positions represent the selected items gives \(\binom{n+r-1}{r}\).


Why is choosing zero items equal to one combination?

There is exactly one way to choose no items: select nothing. This is called the empty selection. It is why \(\binom{n}{0} = 1\) and why \(\binom{0}{0} = 1\) is used as a counting convention.


Can a combination result be very large?

Yes. Combination counts can grow quickly as \(n\) and \(r\) increase. This calculator keeps the result exact within its supported input range, but long values may be shortened visually so the page remains readable.


Why does Pascal's triangle appear in combination problems?

Pascal's triangle is made of binomial coefficients. Since combinations are counted by binomial coefficients, entries in Pascal's triangle match values such as \(\binom{n}{r}\). This is also why combination counts appear in the binomial theorem.


Sources and References

Books and Open Textbooks

  1. Oscar Levin. Discrete Mathematics: An Open Introduction, 4th ed., University of Northern Colorado/Open Math Books, Fall 2024. Sections 3.4 “Combinations and Permutations” and 3.5 “Counting Multisets.” https://discrete.openmathbooks.org/dmoi4/frontmatter.html, https://discrete.openmathbooks.org/dmoi4/sec_counting-combperm.html, and https://discrete.openmathbooks.org/dmoi4/sec_counting-multisets.html. Accessed June 27, 2026.
  2. Jay Abramson. College Algebra 2e. OpenStax, 2021. Section 9.5 “Counting Principles.” https://openstax.org/books/college-algebra-2e/pages/9-5-counting-principles. Accessed June 27, 2026.
  3. Donna Kirk. Contemporary Mathematics. OpenStax, 2023. Sections 7.2 “Permutations” and 7.3 “Combinations.” https://openstax.org/books/contemporary-mathematics/pages/7-2-permutations and https://openstax.org/books/contemporary-mathematics/pages/7-3-combinations. Accessed June 27, 2026.