Combinations Calculator (nCr)

Count the ways to choose r items from n when order does not matter, with exact big-number answers and the cancellation steps shown.

How many different items there are to choose from.
How many are picked at once. Order does not matter.
Order matters, P(n, r)
720arrangements, each combination counted r! times
With repetition allowed
220C(n + r − 1, r) = C(12, 3)
Chance of one set
1 in 120probability = 0.00833333
Same count as
C(10, 7)choosing which items to leave out
Combinations C(10, 3)1203 digits

Show the work

  1. Formula: C(n, r) = n!r! · (n − r)!
  2. Substitute n = 10 and r = 3: C(10, 3) = 10!3! · 7!
  3. Cancel the larger factorial, 7!, against 10!. What remains on top is the 3 largest factors, and 3! stays on the bottom: 10 × 9 × 83 × 2 × 1
  4. Multiply out and divide: 7206 = 120
Every value of k for n = 10
kC(10, k)P(10, k)
011
11010
24590
3120720
42105,040
525230,240
6210151,200
7120604,800
8451,814,400
9103,628,800
1013,628,800

A combination is a selection in which order does not matter: a poker hand, a lottery ticket, a committee. The number of ways to choose r items from n distinct items is written C(n, r), nCr or “n choose r”. This calculator returns that number exactly — no rounding, even when it runs to thousands of digits — and shows how the factorials cancel so you can follow the arithmetic.

How to use the combinations calculator

  1. Enter Total items (n), the number of different things available to choose from.
  2. Enter Items chosen (r), how many are picked at once. Without repeats, r cannot be larger than n.
  3. Read C(n, r) on the tape. Below it you also get the ordered count P(n, r), the count if items could repeat, and the chance of drawing one particular selection.
  4. Tick List the combinations to print the selections themselves, with items labeled A, B, C and so on (up to 500 of them, for n ≤ 100 and r ≤ 12).

For n up to 30, a table shows C(n, k) and P(n, k) for every k from 0 to n — a full row of Pascal’s triangle.

Combinations formula (nCr)

C(n, r) = n! ÷ (r! · (n − r)!)

Here n! is the factorial n × (n − 1) × … × 1. Read the formula as a correction: n! counts every ordering of all n items, dividing by r! forgets the order inside the chosen group, and dividing by (n − r)! forgets the order of the items left out.

You never need the full factorials. The larger factorial in the bottom cancels against the top, leaving a short product:

C(n, r) = n(n − 1)⋯(n − r + 1) ÷ r!

The calculator always cancels whichever of r! and (n − r)! is larger, so C(1,000,000, 999,997) takes three multiplications, not a million.

Worked example: five-card poker hands

How many different 5-card hands can be dealt from a standard 52-card deck? Order does not matter — the same five cards are the same hand — so n = 52 and r = 5.

C(52, 5) = 52! ÷ (5! · 47!)

Cancel 47!: (52 × 51 × 50 × 49 × 48) ÷ (5 × 4 × 3 × 2 × 1)

= 311,875,200 ÷ 120 = 2,598,960

There are 2,598,960 possible hands, so any one specific hand turns up with probability 1 in 2,598,960. The numerator, 311,875,200, is the number of ways to deal five cards in order; each hand appears 5! = 120 times in that count, which is exactly what dividing by 120 removes. The probability of a hand that is all hearts is C(13, 5) ÷ C(52, 5) = 1,287 ÷ 2,598,960, about 0.05%.

Does order matter? Picking the right count

Most counting mistakes come from using the right formula for the wrong situation. Ask two questions: does swapping two chosen items give a different outcome, and can the same item be picked twice?

Situation Order matters? Repeats? Count
Committee of 4 from 12 people No No C(12, 4) = 495
President, VP and treasurer from 12 Yes No P(12, 3) = 1,320
3 scoops from 10 flavors in a cup No Yes C(12, 3) = 220
4-digit PIN Yes Yes 10⁴ = 10,000

When order matters, use the permutations calculator. When an item can be chosen more than once, use the combinations with replacement calculator.

Combinations and lottery odds

If every selection is equally likely, the chance of one particular selection is 1 ÷ C(n, r). Lotteries are the classic case. Powerball draws 5 white balls from 69 and 1 red ball from 26, giving C(69, 5) × 26 = 11,238,513 × 26 = 292,201,338 possible tickets. Mega Millions draws 5 from 70 and 1 from 24: C(70, 5) × 24 = 12,103,014 × 24 = 290,472,336. Buying 10 tickets with different numbers multiplies your chance by 10 — it is still about 1 in 29 million.

Useful properties

  • Symmetry: C(n, r) = C(n, n − r). The tape shows the mirror count for every input.
  • Pascal’s rule: C(n, r) = C(n − 1, r − 1) + C(n − 1, r), which is how Pascal’s triangle is built.
  • Row sums: C(n, 0) + C(n, 1) + … + C(n, n) = 2ⁿ, the number of subsets of an n-item set.
  • Peak in the middle: for fixed n, C(n, r) is largest at r = n/2. C(20, 10) = 184,756, while C(20, 2) is only 190.

Frequently asked questions

What is the difference between a combination and a permutation?

A combination is a group in which order does not matter, so {A, B, C} and {C, B, A} are the same selection. A permutation is an ordered arrangement, so those count as different. Each combination of r items can be put in order r! ways, which is why P(n, r) = C(n, r) × r!.

Why is C(n, 0) equal to 1?

There is exactly one way to choose nothing: the empty selection. The formula agrees, because n! ÷ (0! × n!) = 1 once 0! is defined as 1.

Why does C(n, r) equal C(n, n − r)?

Choosing which r items to take is the same decision as choosing which n − r items to leave behind. Picking 3 of 10 people for a team can be done 120 ways, and so can picking the 7 who stay off it.

How large can n and r be?

Any whole numbers up to 10^15, as long as the answer has no more than 50,000 digits. Every result is computed with exact whole-number arithmetic, and long answers are printed in full below the calculator.

What are the odds of hitting the Powerball jackpot?

A ticket must match 5 of 69 white balls, which can be chosen C(69, 5) = 11,238,513 ways, and 1 of 26 red balls. That makes 11,238,513 × 26 = 292,201,338 equally likely tickets, so the chance is 1 in 292,201,338.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.