Math

Combinations Calculator

Settings
Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Please enter a valid URL. Only HTTPS URLs are supported.


Use as default values for the embed calculator what is currently in input fields of the calculator on the page.


Input border focus color, switchbox checked color, select item hover color etc.


Please agree to the Terms of Use.

Preview

Save calculator

Calculator Settings

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Share calculator

What is a combinations calculator?

A combinations calculator works out how many different ways you can choose a group of items from a larger set when the order of selection does not matter. This quantity is called the number of combinations, written as nCr{}^{n}C_{r}, “n choose r”, or with the binomial coefficient (nr)\binom{n}{r}. Here nn is the total number of available items and rr is how many of them you pick.

Combinations appear whenever you care only about which items end up together, not the sequence in which they were chosen. Picking 2 toppings out of 5 gives the same pizza no matter which topping you name first, so it is a combination problem. If the order mattered, you would be counting permutations instead.

How does it work?

Enter the total number of items nn and the number you want to choose rr, and the calculator returns nCr{}^{n}C_{r} instantly. Both values must be whole numbers, and rr cannot be larger than nn — you cannot choose more items than you have. If r>nr > n, or either field is left empty, the result stays blank.

Formula

The number of combinations is given by the binomial coefficient:

nCr=(nr)=n!r!(nr)!{}^{n}C_{r} = \binom{n}{r} = \frac{n!}{r!\,(n-r)!}

Here n!n! (n factorial) is the product of all positive integers up to nn, so 5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120. By convention 0!=10! = 1, which is why choosing zero items, or choosing all of them, always gives exactly one combination.

A few useful identities follow directly from the formula:

  1. (n0)=1\binom{n}{0} = 1 — there is one way to choose nothing.
  2. (nn)=1\binom{n}{n} = 1 — there is one way to choose everything.
  3. (nr)=(nnr)\binom{n}{r} = \binom{n}{n-r} — choosing rr to keep is the same as choosing nrn-r to leave out.

Worked examples

  1. Example 1: Choose 2 items from 5. (52)=5!2!3!=1202×6=10\binom{5}{2} = \frac{5!}{2!\,3!} = \frac{120}{2 \times 6} = 10.
  2. Example 2: Choose 3 items from 10. (103)=10!3!7!=36288006×5040=120\binom{10}{3} = \frac{10!}{3!\,7!} = \frac{3628800}{6 \times 5040} = 120.
  3. Example 3: Choose all 5 from 5. (55)=5!5!0!=1\binom{5}{5} = \frac{5!}{5!\,0!} = 1.
  4. Example 4: Choose 0 from 5. (50)=5!0!5!=1\binom{5}{0} = \frac{5!}{0!\,5!} = 1.

Practical notes

  • Combinations count unordered selections. If the arrangement matters — for example seating people in a row — use permutations, where nPr=n!(nr)!{}^{n}P_{r} = \frac{n!}{(n-r)!}.
  • The values grow quickly because of the factorials, so even modest inputs can yield very large counts.
  • Combinations underpin probability, the binomial distribution, lottery odds, card-hand counting, and combinatorial design problems.

Frequently asked questions

What is the difference between combinations and permutations?

In combinations the order of the chosen items does not matter, so {A,B}\{A, B\} and {B,A}\{B, A\} count as one selection. In permutations order matters, so they count as two. As a result there are always at least as many permutations as combinations for the same nn and rr.

Why is choosing 0 items equal to 1?

Because 0!=10! = 1, the formula gives (n0)=n!0!n!=1\binom{n}{0} = \frac{n!}{0!\,n!} = 1. Intuitively, there is exactly one way to select nothing at all — the empty selection.

Can r be larger than n?

No. You cannot choose more items than exist in the set, so (nr)\binom{n}{r} is only defined for 0rn0 \le r \le n. This calculator returns a blank result when r>nr > n.

Report a bug

This field is required.