Calculators tool

Combination calculator

How many ways to choose or arrange r things from n, with and without repetition.

Combination calculator Runs on your device
  • Runs in your browser — nothing you enter is uploaded
  • No sign-up, no quotas, free to use as often as you like

How it works

The whole subject turns on one question: does the order matter? If it does you want permutations, if it does not you want combinations, and the two differ by a factor of r factorial — which gets large very quickly.

Combinations and permutations

Choosing 3 people from 10 for a committee is a combination: 120 ways, because the order you pick them in does not change the committee. Choosing 3 from 10 for gold, silver and bronze is a permutation: 720 ways, because it does. Same numbers, six times the answer.

Lottery odds

Set n to the number of balls and r to how many are drawn, and the combinations figure is the number of possible tickets — so the odds of any one ticket are one in that. A 6-from-49 draw gives 13,983,816, which is the honest way to see what a ticket buys.

With repetition

If the same item can be chosen more than once, the counts change: arrangements become n to the power of r, which is the right model for a PIN or a combination lock, and combinations follow the stars-and-bars formula. Both are shown.

Where it stops

Factorials grow faster than almost anything else. 170 factorial is about the largest that fits in a JavaScript number at all, so n is capped there and very large results are shown in scientific notation rather than being quietly rounded to something wrong.

FAQ

Combination calculator — questions

What is the difference between nCr and nPr?

nCr counts selections where order does not matter; nPr counts arrangements where it does. nPr is always the larger.

How do I work out lottery odds?

Set n to the number of balls and r to how many are drawn. The combinations figure is the number of possible tickets.

When should I use the repetition figures?

When the same item can be picked more than once — a PIN or a lock code, where 1-1-1 is allowed.

Why is there a limit on n?

Factorials exceed the largest number JavaScript can represent above 170, so results beyond that cannot be trusted.

Is 0! really 1?

Yes. There is exactly one way to arrange nothing, which the convention reflects.