COMBINATORICS · nCr

Combination Calculator

Work out n choose r with or without repetition — every step of the working shown, and answers exact to the final digit, even when they run thousands of digits long.

FREE · NO SIGN-UP · RUNS IN YOUR BROWSER
01 · CALCULATOR

Calculate n choose r

Enter n and r, choose whether items may repeat, and get the exact answer with the full working — computed with big-integer math, so nothing ever gets rounded.

INPUT C(n, r)

Every item is distinct and can be picked at most once — the classic nCr from textbooks.

TRY

Runs entirely in your browser — nothing you type leaves this page. Whole numbers from 0 to 10,000 for both n and r.

02 · HOW TO USE

Three steps to an answer

01

Pick a mode

Without repetition counts distinct items — committees, card hands, lottery draws. With repetition counts multisets where repeats are allowed, like 3 scoops from 12 flavours (double chocolate very much permitted).

02

Enter n and r

n is how many items exist, r is how many you’re choosing. Whole numbers from 0 to 10,000. The engine is exact big-integer math — even C(10000, 5000) comes out correct, all ~3,000 digits of it.

03

Read — or take — the answer

The exact value leads, the full working follows, and a permutation comparison puts the number in context. One tap on the copy icon and “C(52, 5) = 2598960” is on its way wherever you need it.

03 · THE MATH

Combinations, in plain language

A combination counts the ways to choose r things out of n when order doesn’t matter. Grab 2 books off a shelf of 5 — Moby-Dick then Gilgamesh is the same pair as Gilgamesh then Moby-Dick, so it counts once. That shelf gives C(5, 2) = 10 pairs.

C(n, r) = n!r! × (n − r)!
  • n! — every possible arrangement of all n items. We start by over-counting on purpose.
  • r! — the orderings of the r chosen items that shouldn’t count separately.
  • (n − r)! — the orderings of everything left behind, also over-counted.

Divide the over-count away and what survives is pure selection: the number of distinct r-item subsets. When repeats are allowed, the same bookkeeping done with stars and bars yields C′(n, r) = C(n + r − 1, r) — the mode this calculator switches to with one tap.

CombinationPermutation
Does order matter?NoYes
Formulan!/(r!(n−r)!)n!/(n−r)!
5 items, choose 21020
Same 2 items1 selection2! = 2 orders
Feels likea hand of cardsa finishing order
04 · FAQ

Frequently asked questions

Short answers to the questions that come up most — the full working lives in the calculator above.

What is a combination?
A combination is a way of choosing r items from a set of n where order doesn’t matter. {A, B} and {B, A} count as one combination, not two. If you’re picking a team, it’s a combination; if you’re assigning roles inside the team, order kicks in and you’re in permutation territory.
What is the nCr formula?
C(n, r) = n! / (r! × (n − r)!). The numerator n! counts every arrangement of all n items — deliberate over-counting. Dividing by r! collapses the orderings inside your selection, dividing by (n − r)! collapses the orderings of what’s left, and what remains is pure choice. Worked example: C(5, 2) = 120 / (2 × 6) = 10.
What’s the difference between a combination and a permutation?
Order. A permutation counts A-then-B and B-then-A as different outcomes; a combination doesn’t. That’s why P(n, r) = C(n, r) × r! — every combination supports r! orderings — and why permutation counts are always the bigger (or equal) number. Choose 2 of 5: 10 combinations, 20 permutations.
How do I calculate combinations with repetition?
When items can be chosen more than once, use the stars-and-bars formula: C′(n, r) = C(n + r − 1, r). Three flavours, two scoops: C(4, 2) = 6 — chocolate-chocolate, chocolate-vanilla, chocolate-strawberry, vanilla-vanilla, vanilla-strawberry, strawberry-strawberry.
What are n choose 0 and n choose n?
Both are exactly 1: there’s one way to choose nothing, and one way to take everything. Their cousins are just as tidy — C(n, 1) = n, and by symmetry C(n, r) = C(n, n − r), since choosing r to keep is the same as choosing n − r to leave behind.
What happens if r is greater than n?
Without repetition: 0 — you can’t pick more distinct items than exist. With repetition it’s perfectly legal, because items can be reused: C′(3, 5) = C(7, 5) = 21. The calculator tells you which situation you’re in.
How many 5-card poker hands are there in a 52-card deck?
C(52, 5) = 2,598,960 — every possible 5-card hand from a standard deck, which is why the 4 royal flushes feel like unicorns. Lotteries work the same way: Powerball’s white balls give C(69, 5) = 11,238,513 combinations, and your jackpot odds are 1 in that × 26.