How many ways can you choose r things from a set of n? The answer depends on two questions: does the order of the chosen items matter, and can an item be chosen more than once? Set n and r, answer those two questions, and this calculator gives the exact count, the formula with your numbers substituted into it, and all four counts side by side so the difference between the cases is visible at a glance.
How to use this calculator
- Enter n, the total number of items you are choosing from (players in a squad, flavours on the menu, digits on a dial).
- Enter r, how many you choose (team size, scoops, code length).
- Decide whether order matters. A committee of 3 is the same committee whichever order the names are read out: order does not matter, use combinations. A finishing order of 1st, 2nd, 3rd changes when the order changes: use permutations.
- Decide whether items can repeat. People cannot be picked twice, so most selections are without replacement. A PIN digit can repeat (you can have 1111), so codes use replacement.
- Press Calculate. You get the exact count, the formula with your numbers in it, and a small table with all four cases for the same n and r.
The four formulas
All counting of selections falls into four cases. Two formulas cover the no-replacement cases, and both are built from factorials (n! means n × (n−1) × … × 1):
The combination formula is the permutation formula with the r! arrangements of each chosen set divided back out, which is exactly why C(n, r) is smaller than P(n, r) by a factor of r! whenever both exist. C(n, r) is also called the binomial coefficient, written “n choose r”, and it is the number that appears in Pascal’s triangle and in the binomial expansion.
With replacement, an item goes back into the pool after each pick, so the pool never shrinks:
The last formula surprises people, so here is the intuition: choosing r items from n types with repeats allowed is the same as placing r markers into n boxes, and the standard “stars and bars” argument turns that into an ordinary combination with n + r − 1 positions. This calculator does the arithmetic with exact whole numbers of unlimited size (arbitrary precision), so even counts with thousands of digits are exact, never rounded.
Worked examples
Example 1: a committee of 3 from 10 people
Order does not matter and nobody can be picked twice, so C(10, 3) = 10! / (3! × 7!) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120 possible committees. For the same n and r the other three counts are 720 (ordered, no repeats), 220 (unordered, repeats allowed) and 1,000 (ordered, repeats allowed), which the results table shows together.
Example 2: gold, silver and bronze from 8 runners
The podium is ordered: swapping gold and bronze gives a different outcome. Without replacement, P(8, 3) = 8! / 5! = 8 × 7 × 6 = 336 possible podiums. The unordered count for the same race is only C(8, 3) = 56, because each set of three medalists can stand on the podium in 3! = 6 orders, and 56 × 6 = 336.
Example 3: a 6-from-49 lottery
A lottery draw picks 6 balls from 49, order irrelevant, no repeats: C(49, 6) = 13,983,816 possible tickets. That single count is the whole reason the jackpot is hard to win: one ticket covers exactly one of nearly 14 million combinations.
Example 4: three scoops, repeats allowed
A cone with 3 scoops chosen from 10 flavours, where a flavour may repeat and the order of scoops in the cone does not create a new dessert: combinations with replacement, C(10 + 3 − 1, 3) = C(12, 3) = 220. Contrast a 4-digit code from 10 digits, where order matters and digits repeat: 104 = 10,000 codes.
Reading your results
The big number is the exact count for the case you selected, with commas for readability. Counts too long to read comfortably also get a digit count and an approximate value in the form 1.009 × 1029, so the scale is clear while the exact figure stays on screen.
The substitution line shows the formula with your n and r inside it, and, for small r, the cancelled product (for example (10 × 9 × 8) / (3 × 2 × 1)). Checking a result by hand is easiest from that line.
The four-case table is the fastest way to feel the two choices. Turning order on multiplies the count by r! (when no replacement is involved). Turning replacement on always increases the count, because every old outcome is still possible and repeated items add new ones.
From counts to probability: if every outcome is equally likely, the probability of one specific outcome is 1 divided by the count. Counting is the hard part; the probability calculator linked below takes it from there.
Common mistakes
- Using permutations for a committee or a hand of cards. If the group is the same group regardless of the order its members were picked, it is a combination. Overcounting by r! is the most common counting error there is.
- Forgetting that lottery balls do not repeat. A standard draw is without replacement; allowing repeats would give C(54, 6) style counts for a 49-ball game, which overstates the number of tickets and understates nothing else. Check the real rules of the game.
- Trying r larger than n without replacement. You cannot pick 12 distinct people from a pool of 10. The calculator refuses it and says why; with replacement it is allowed, because the pool refills.
- Assuming C(n, r) needs r to be small. C(100, 50) = 100,891,344,545,564,193,334,812,497,256, a 30-digit exact count, is computed here without rounding. Symmetry helps by hand: C(n, r) = C(n, n−r), so C(100, 97) is just C(100, 3) = 161,700.
- Mixing the two questions. “Does order matter” and “can it repeat” are independent choices. A code is ordered with replacement; a committee is unordered without; a podium is ordered without; scoops are unordered with. All four combinations of answers occur in real life.
Limitations
- This calculator counts selections from a single pool of distinct items. Selections with separate quotas from separate groups (for example 2 defenders from 8 and 3 attackers from 9) need one count per group, multiplied together; run the calculator once per group.
- n and r are capped at 2,000 to keep results instant. The arithmetic is exact at any size, so the cap is about screen space, not precision.
- The counts assume every item in the pool is distinct and every selection of the stated type is possible. Real rules (eligibility, position limits, banned combinations) reduce the true count and are not modelled here.
- Counts are not probabilities until you divide: this page deliberately stops at the count, and the probability pages handle the division and the interpretation.
Frequently asked questions
What is the difference between a combination and a permutation?
A permutation counts arrangements, where order matters: ABC and BAC are different permutations. A combination counts sets, where order does not matter: ABC and BAC are the same combination. For the same n and r without replacement, P(n, r) = C(n, r) × r!.
What does nCr mean?
nCr is the calculator-button name for C(n, r), the number of combinations of r items chosen from n. Its twin nPr is P(n, r), the permutations. This page is an nCr and nPr calculator with the replacement cases included.
Why can r not be bigger than n?
Without replacement, each pick removes an item, so after n picks the pool is empty; an (n+1)th distinct pick does not exist. With replacement the pool refills after every pick, so r can be as large as you like (up to the 2,000 cap here).
What does “with replacement” actually mean?
After each pick, the item is put back, so it can be picked again. Drawing a card and returning it before the next draw is with replacement; keeping the card is without. PIN codes, dice rolls and repeated scoops of the same flavour are the everyday with-replacement cases.
Is C(n, r) the same as the binomial coefficient?
Yes. C(n, r) is the binomial coefficient “n choose r”: the coefficient of xr in (1 + x)n, and the entry in row n, position r of Pascal’s triangle. That is why combination counts appear in algebra as well as in counting.
How can the count have thousands of digits and still be exact?
The calculator multiplies whole numbers using arbitrary-precision arithmetic, the same technique the Long Division and Decimal Calculator on this site uses for exact decimals. No floating-point rounding happens anywhere in the count, so the last digit is as correct as the first.
Related calculators
- Math calculators
- Probability Calculator: turn these counts into probabilities of specific outcomes.
- Descriptive Statistics Calculator: summarise the data once outcomes are observed.
Method: C(n, r) = n! / (r! (n−r)!); P(n, r) = n! / (n−r)!; with replacement nr and C(n + r − 1, r). Counts computed in arbitrary-precision integer arithmetic and checked against independently calculated fixtures, including C(100, 50). Last reviewed: 20 October 2026.
Disclaimer: This calculator gives estimates for general information only. It is not financial, medical or other professional advice.
