Combination Calculator

Find the number of ways to choose r items from n items where order does not matter. Shows full formula expansion and lists all combinations for small inputs.

🔢 Combination Calculator

Counts unordered selections. Order does not matter.

Lists every combination as a set. Available for n ≤ 10 and r ≤ 5.

Total Items (n)10
items
030
Items to Choose (r)3
items
0n
C(10,3)
P(10,3)
C(n,r) Expansion
P(n,r) Expansion

🔢 What is a Combination?

A combination C(n, r) is the number of ways to select r items from a set of n items when the order of selection does not matter. If you are choosing a committee of 3 people from a group of 10, the group {Alice, Bob, Carol} is the same as {Carol, Alice, Bob}: both are one combination. The formula is C(n, r) = n! / (r! × (n-r)!), where n! means n factorial (the product of all positive integers from 1 to n).

Combinations appear in many real-world contexts. In poker, every 5-card hand is a combination: C(52, 5) = 2,598,960 distinct hands from a 52-card deck. In a lottery where you pick 6 numbers from 1 to 49, there are C(49, 6) = 13,983,816 possible tickets. In a biology experiment selecting 4 samples from a batch of 20, C(20, 4) = 4,845 ways to draw the sample. Any time you are grouping or selecting without regard to sequence, you are working with combinations.

The key distinction from permutations: combinations ignore order, permutations do not. Selecting 3 toppings for a pizza does not depend on which order you point at them (combination). Assigning gold, silver, and bronze medals to 3 runners from 10 depends on which person gets which medal (permutation). The relationship is P(n,r) = r! × C(n,r): permutations are always larger than or equal to combinations because each unordered group of r items can be arranged in r! different orders.

This calculator computes C(n, r) using the multiplicative formula, which avoids computing full factorials and stays numerically stable for large inputs. For small inputs (n ≤ 10, r ≤ 5), the List All mode generates every actual combination as a set, which is useful for students learning combinatorics visually. The expansion shown in the results breaks down the arithmetic step by step so you can follow the calculation manually.

📐 Formula

C(n, r)  =  n! ÷ (r! × (n − r)!)
n = total number of items in the set
r = number of items being chosen (0 ≤ r ≤ n)
n! = n factorial = n × (n−1) × (n−2) × … × 2 × 1
Multiplicative form: C(n,r) = [n × (n−1) × … × (n−r+1)] ÷ [r × (r−1) × … × 1]
Symmetry: C(n,r) = C(n, n−r). Choosing r items to include is the same as choosing n-r items to exclude.
Example: C(10,3) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120
vs Permutation: P(n,r) = n! / (n−r)! = r! × C(n,r). So P(10,3) = 6 × 120 = 720

📖 How to Use This Calculator

Steps

1
Enter n (total items) - Type or drag the slider to set n, the total count of items in your set. Examples: 52 for a deck of cards, 49 for lottery numbers, 10 for a group of people.
2
Enter r (items to choose) - Type or drag the r slider to set the selection size. r must be between 0 and n. If you enter r larger than n, the calculator clamps to n automatically.
3
Click Calculate to see C(n,r) - The results show C(n,r) as the primary answer, P(n,r) as secondary, and a step-by-step multiplication expansion for small r. Switch to List All mode to see every actual combination for n up to 10 and r up to 5.

💡 Example Calculations

Example 1 - Choosing a Committee of 3 from 10 People

How many 3-person committees can be formed from a group of 10?

1
n = 10 (total people), r = 3 (committee size). Order does not matter: {Alice, Bob, Carol} = {Carol, Alice, Bob}.
2
C(10,3) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120
3
Compare: P(10,3) = 10 × 9 × 8 = 720. There are 720 ordered arrangements but only 120 unordered groups, since each group of 3 can be ordered in 3! = 6 ways.
C(10,3) = 120 possible committees
Try this example →

Example 2 - 5-Card Poker Hands from 52 Cards

How many distinct 5-card poker hands are possible from a standard deck?

1
n = 52 (cards in a deck), r = 5 (hand size). Each hand is an unordered set of 5 cards.
2
C(52,5) = (52 × 51 × 50 × 49 × 48) / (5 × 4 × 3 × 2 × 1) = 311,875,200 / 120 = 2,598,960
3
Of the 2,598,960 hands: 4 are royal flushes (1 per suit), giving a royal flush probability of 4 / 2,598,960 = 0.000154%.
C(52,5) = 2,598,960 distinct poker hands
Try this example →

Example 3 - Lottery: 6 Numbers from 1 to 49

How many possible lottery tickets exist when choosing 6 numbers from 1 to 49?

1
n = 49, r = 6. Lottery numbers are unordered: {3, 14, 22, 31, 40, 48} is the same ticket regardless of pick order.
2
C(49,6) = (49 × 48 × 47 × 46 × 45 × 44) / (6 × 5 × 4 × 3 × 2 × 1) = 10,068,347,520 / 720 = 13,983,816
3
Each ticket covers 1 of 13,983,816 combinations. Odds of winning the jackpot with one ticket = 1 in 13,983,816 (about 0.0000072%).
C(49,6) = 13,983,816 possible lottery tickets
Try this example →

Example 4 - List All Combinations: Choose 2 from 5

List every way to choose 2 items from a set of 5: {1, 2, 3, 4, 5}

1
C(5,2) = (5 × 4) / (2 × 1) = 20 / 2 = 10. There are 10 possible pairs.
2
The 10 combinations are: {1,2}, {1,3}, {1,4}, {1,5}, {2,3}, {2,4}, {2,5}, {3,4}, {3,5}, {4,5}.
3
Each pair appears once. Note that {1,2} and {2,1} are the same pair, counted once. Switch to List All mode to see the full enumeration generated automatically.
C(5,2) = 10 combinations
Try this example →

❓ Frequently Asked Questions

What is the combination formula C(n,r)?+
C(n,r) = n! / (r! x (n-r)!), where n! = n x (n-1) x ... x 2 x 1. The multiplicative form is faster to compute: C(n,r) = [n x (n-1) x ... x (n-r+1)] / [r x (r-1) x ... x 1]. For C(10,3): numerator = 10 x 9 x 8 = 720; denominator = 3 x 2 x 1 = 6; result = 120. This counts unordered selections of r items from a set of n.
How is C(n,r) different from P(n,r)?+
C(n,r) counts unordered selections (order does not matter). P(n,r) counts ordered arrangements (order matters). P(n,r) = r! x C(n,r). For C(5,3) = 10, each of those 10 groups can be arranged in 3! = 6 different orders, giving P(5,3) = 60. Use combinations for committees, card hands, or any grouping. Use permutations for rankings, passwords, or any ordered sequence.
What is C(n,0) and why does it equal 1?+
C(n,0) = 1 for any n. The formula gives n! / (0! x n!) = n! / (1 x n!) = 1. The combinatorial interpretation: there is exactly one way to choose zero items from any set, and that is the empty selection. This is a base case used in Pascal's Triangle (every row starts and ends with 1) and in the binomial theorem where the x^0 term has coefficient C(n,0) = 1.
What is Pascal's Triangle and how does it relate to combinations?+
Pascal's Triangle is a triangular array where each entry is the sum of the two entries above it. The n-th row (starting from n=0) contains the values C(n,0), C(n,1), ..., C(n,n). Row 4 is: 1, 4, 6, 4, 1 which equals C(4,0)=1, C(4,1)=4, C(4,2)=6, C(4,3)=4, C(4,4)=1. The sum of row n = 2^n, so row 4 sums to 16. Pascal's Triangle lets you find combinations quickly for small n by reading off entries.
What is the combination formula when r equals n?+
C(n,n) = 1. The formula gives n! / (n! x 0!) = n! / (n! x 1) = 1. This makes sense: there is exactly one way to choose all n items from a set of n, and that is to take everything. Similarly, C(n,1) = n (there are n ways to choose exactly one item) and C(n,2) = n(n-1)/2 (the number of unique pairs from n items).
How do I calculate large combinations like C(52,5) by hand?+
Use the multiplicative formula and cancel common factors as you go: C(52,5) = (52 x 51 x 50 x 49 x 48) / (5 x 4 x 3 x 2 x 1). Simplify step by step: 50/5 = 10, 48/4 = 12, 51/3 = 17, then 52 x 17 = 884, 884 x 10 = 8,840, 8,840 x 49 = 433,160, 433,160 x 12 / 2 = 433,160 x 6 = 2,598,960. Canceling factors early prevents intermediate overflow and makes the arithmetic manageable.
What is a combination vs a subset?+
They are the same thing. Choosing r items from a set of n is equivalent to selecting an r-element subset of an n-element set. C(n,r) counts the number of r-element subsets of an n-element set. The total number of all subsets of an n-element set (including the empty set and the full set) is the sum from r=0 to n of C(n,r), which equals 2^n. A set of 3 items has 2^3 = 8 subsets: the empty set plus 3 one-element subsets plus 3 two-element subsets plus the full set.
How does the combination formula apply to probability?+
Combinations are fundamental to probability calculations for equally likely outcomes. The probability of an event A = (favorable outcomes) / (total outcomes). For the lottery C(49,6) = 13,983,816 total outcomes. If 1 ticket wins, P(win) = 1/13,983,816. For poker, P(royal flush) = 4 / C(52,5) = 4 / 2,598,960 = 0.0015%. Hypergeometric probability uses combinations to compute the probability of drawing k specific items from a population of N with K successes.
What is the binomial coefficient and how is it related to combinations?+
The binomial coefficient is another name for C(n,r), often written as (n choose r) with n on top and r on the bottom in parentheses. It appears in the binomial theorem: (x + y)^n = sum from k=0 to n of C(n,k) x^k y^(n-k). The coefficient C(n,k) tells you how many terms in the expansion have x^k y^(n-k). For (x+y)^4: coefficients are C(4,0)=1, C(4,1)=4, C(4,2)=6, C(4,3)=4, C(4,4)=1, giving x^4 + 4x^3y + 6x^2y^2 + 4xy^3 + y^4.
Can the combination formula give a result greater than 1 billion?+
Yes, for large enough n and r. C(49,6) = 13,983,816. C(100,50) = 100,891,344,545,564,193,334,812,497,256 (about 10^29). JavaScript numbers can represent up to about 10^308, but lose precision above 2^53 (about 9 x 10^15). This calculator uses the multiplicative formula with rounding, which gives exact results for most practical inputs and switches to scientific notation for very large values. For cryptographic-precision large combinations, use Python with arbitrary-precision integers.
What is the formula for combinations with repetition?+
Combinations with repetition (also called multiset coefficients) use the formula CR(n,r) = C(n+r-1, r) = (n+r-1)! / (r! x (n-1)!). This counts the number of ways to choose r items from n types when repetition is allowed and order does not matter. Example: choosing 2 scoops of ice cream from 5 flavors with repetition gives CR(5,2) = C(6,2) = 15 (since you can choose the same flavor twice). This calculator computes standard combinations without repetition. For combinations with repetition, enter n+r-1 as your n value and r as your r value.

What is a combination in math and how is it calculated?

A combination C(n,r) counts the number of ways to select r items from a set of n items when order does not matter. The formula is C(n,r) = n! / (r! x (n-r)!). For example, C(5,2) = 5! / (2! x 3!) = 120 / 12 = 10. This means there are 10 ways to choose 2 items from a set of 5.

What is the difference between combinations and permutations?

Combinations count selections where order does not matter (C(n,r) = n! / (r! x (n-r)!)). Permutations count arrangements where order does matter (P(n,r) = n! / (n-r)!). Example: choosing 2 people for a committee from 5 gives C(5,2) = 10 combinations. Arranging 2 people in ranked positions from 5 gives P(5,2) = 20 permutations. Every combination corresponds to r! permutations, so P(n,r) = r! x C(n,r).

How many combinations are there in a deck of 52 cards for 5 cards?

C(52,5) = 2,598,960. This is the total number of distinct 5-card poker hands from a standard 52-card deck. The formula: C(52,5) = (52 x 51 x 50 x 49 x 48) / (5 x 4 x 3 x 2 x 1) = 311,875,200 / 120 = 2,598,960. Of these, 4 are royal flushes, 36 are straight flushes, 624 are four-of-a-kind, and so on.

What is nCr and how do I read the notation?

nCr is shorthand for 'n choose r', which is the combination formula C(n,r). The n represents the total number of items in the set, and r represents the number you are choosing. You read '10C3' as '10 choose 3', which equals 120. Alternative notations include C(10,3), (10 3) (binomial coefficient notation), and 10C3 on calculators.

What is C(n,0) and C(n,n)?

Both equal 1. C(n,0) = 1 because there is exactly one way to choose nothing from a set: the empty set. C(n,n) = 1 because there is exactly one way to choose all n items: take everything. These are the boundary cases of the combination formula and are important base cases in combinatorial proofs and Pascal's Triangle.

Why is C(n,r) equal to C(n, n-r)?

Choosing r items to include in a group is equivalent to choosing n-r items to exclude. Each selection of r items corresponds to exactly one selection of the remaining n-r items. Therefore C(10,3) = C(10,7) = 120. This symmetry property is used to speed up computation: always compute the smaller of C(n,r) and C(n,n-r).

How do I calculate C(49,6) for lottery odds?

C(49,6) = (49 x 48 x 47 x 46 x 45 x 44) / (6 x 5 x 4 x 3 x 2 x 1) = 10,068,347,520 / 720 = 13,983,816. This means there are 13,983,816 possible ways to pick 6 numbers from 1 to 49. Each lottery ticket covers exactly one of these combinations, giving a 1 in 13,983,816 chance of winning the jackpot with a single ticket.

What does it mean when r is greater than n in a combination?

When r > n, C(n,r) = 0. There are zero ways to choose more items than exist in the set. For example, you cannot choose 6 people for a committee from a group of only 4 people. The formula confirms this: n! / (r! x (n-r)!) with r > n would require (n-r)! = (-k)! for a negative integer, which is undefined. By convention C(n,r) = 0 whenever r > n.