Free to Use

📊 Combination Calculator (nCr)

Calculate the number of combinations — ways to choose r items from a set of n items where order does not matter. Perfect for probability, statistics, combinatorics, and lottery calculations.

The total number of items to choose from
The number of items being selected
🧮
Instant nCr Calculation
Get the exact number of combinations instantly. Enter n (total items) and r (items to choose), and the calculator does the rest.
📝
Step-by-Step Factorials
See the full factorial expansion for n!, r!, and (n-r)! with clear step-by-step working shown in detail.
🎯
Probability & Statistics Ready
Essential for binomial probability, lottery odds, poker hand calculations, and many statistical sampling problems.
Handles Large Numbers
Supports combinations for n up to 170 with precise calculation. Ideal for real-world combinatorics and probability problems.

What Is a Combination (nCr)?

A combination is a selection of items from a larger set where the order of selection does not matter. In mathematics, combinations are used to count the number of ways to choose a subset of items from a larger set. The notation C(n, r) or nCr represents the number of ways to choose r items from a set of n distinct items.

For example, if you have a set of 5 fruits {apple, banana, cherry, date, elderberry} and you want to choose 2 of them, the number of possible combinations is C(5,2) = 10. The pair {apple, banana} is considered the same combination as {banana, apple} because order does not matter.

The combination formula is derived from the permutation formula by dividing out the r! ways that the chosen items can be ordered. This gives us the number of unordered selections.

The Combination Formula

C(n, r) = nCr = n! / (r! × (n-r)!)
Where n ≥ r ≥ 0, and both n and r are non-negative integers
n! = n × (n-1) × (n-2) × ... × 2 × 1
The factorial of n — the product of all positive integers from 1 to n
Special cases: C(n, 0) = 1, C(n, 1) = n, C(n, n) = 1
There is exactly 1 way to choose nothing, n ways to choose 1 item, and 1 way to choose all items

Key Properties of Combinations

Real-World Combination Examples

🃏 Poker Hand Combinations

Problem: How many different 5-card poker hands can be dealt from a standard 52-card deck?

Solution: n = 52 (total cards), r = 5 (cards in a hand).

C(52,5) = 52! / (5! × 47!) = 2,598,960 possible poker hands.

The order of cards in your hand doesn't matter — the same 5 cards in any order is the same hand.

🍕 Pizza Toppings

Problem: A pizza parlor offers 8 toppings. How many different 3-topping pizzas can you order?

Solution: n = 8 (toppings), r = 3 (toppings per pizza).

C(8,3) = 8! / (3! × 5!) = 56 different 3-topping pizzas.

Choosing pepperoni, mushrooms, and olives is the same pizza regardless of the order you list them.

🎯 Lottery Odds

Problem: In a lottery, you must correctly choose 6 numbers from 1 to 49. What are the total possible combinations?

Solution: n = 49 (total numbers), r = 6 (numbers to pick).

C(49,6) = 49! / (6! × 43!) = 13,983,816 possible combinations.

Your odds of winning the jackpot with a single ticket are 1 in 13,983,816.

👥 Committee Selection

Problem: A club has 12 members and needs to select a committee of 4 people. How many different committees can be formed?

Solution: n = 12 (members), r = 4 (committee size).

C(12,4) = 12! / (4! × 8!) = 495 possible committees.

A committee of Alice, Bob, Charlie, and Diane is the same committee regardless of the order they are listed.

Common Applications of Combinations

🎲 Probability & Statistics

Combinations are fundamental to calculating probabilities in games of chance, survey sampling, and the binomial probability distribution formula.

🧬 Genetics & Biology

Geneticists use combinations to calculate possible gene combinations, Punnett square outcomes, and the probability of inheriting specific traits.

🛒 Business & Logistics

Used in supply chain optimization, inventory selection problems, scheduling, and determining possible team configurations for projects.

📊 Data Science & ML

Feature selection in machine learning, combinatorial optimization, and analyzing subsets of data all rely on combination calculations.

🎮 Game Design

Game developers use combinations to design card decks, loot tables, character builds, and any system involving selecting items from a pool.

🔐 Cryptography

Combination counting is essential in analyzing key spaces, password strength estimation, and understanding the computational difficulty of certain cryptosystems.

Frequently Asked Questions

What is the difference between combinations and permutations?
Combinations (nCr) count selections where order does NOT matter. For example, choosing 3 fruits from a basket of 5 — {apple, banana, cherry} is the same as {cherry, banana, apple}.

Permutations (nPr) count selections where order DOES matter. For example, selecting a president, vice president, and treasurer from 10 candidates — the order (who gets which role) matters.

The relationship is: P(n,r) = r! × C(n,r). Permutations are r! times larger because each combination of r items can be arranged in r! different orders.
What does C(n,0) mean and why does it equal 1?
C(n,0) = 1 means there is exactly 1 way to choose nothing from a set of n items. While it might seem counterintuitive, the empty set is a valid subset of any set. Mathematically, the formula gives C(n,0) = n! / (0! × n!) = 1, since 0! is defined as 1. This is consistent with the binomial theorem and Pascal's Triangle.
Can n be smaller than r in combinations?
No, n must be greater than or equal to r (n ≥ r) for a valid combination. You cannot choose more items than are available. If r > n, the combination C(n,r) is defined as 0 — there are zero ways to choose r items from a set of only n items. In our calculator, if you enter r > n, we'll show a helpful error message explaining this.
What is the relationship between combinations and Pascal's Triangle?
Pascal's Triangle is a triangular array of numbers where each number is the sum of the two numbers directly above it. The numbers in Pascal's Triangle are exactly the combination values C(n,r). Row n of Pascal's Triangle contains the values C(n,0), C(n,1), C(n,2), ..., C(n,n).

For example, row 4 is: 1, 4, 6, 4, 1 — which corresponds to C(4,0)=1, C(4,1)=4, C(4,2)=6, C(4,3)=4, C(4,4)=1.

The recursive property C(n,r) + C(n,r+1) = C(n+1,r+1) is exactly how Pascal's Triangle is constructed.
How do combinations relate to the Binomial Theorem?
The Binomial Theorem states that (x + y)ⁿ = Σ C(n,k) × xⁿ⁻ᵏ × yᵏ for k = 0 to n. The coefficients C(n,k) are called binomial coefficients for exactly this reason — they are the coefficients that appear when expanding a binomial expression.

For example: (x + y)⁴ = C(4,0)x⁴ + C(4,1)x³y + C(4,2)x²y² + C(4,3)xy³ + C(4,4)y⁴
= 1x⁴ + 4x³y + 6x²y² + 4xy³ + 1y⁴

This is why nCr values are also written as binomial coefficients with the notation (ⁿᵣ).
What is the largest n that this calculator can handle?
This calculator can accurately compute combinations for n up to 170. Values of n larger than 170 produce factorials that exceed JavaScript's maximum safe integer (Number.MAX_SAFE_INTEGER ≈ 9.0 × 10¹⁵), which can lead to rounding errors. For most practical problems (lotteries, card games, committees, etc.), this range is more than sufficient. For extremely large n values, we recommend using a specialized arbitrary-precision combinatorics library.

⚠️ Important Note: This Combination Calculator is for educational and informational purposes only. Combination calculations assume all items are distinct and selections are made without replacement. For critical applications involving gambling, financial decisions, or scientific research, results should be verified independently. Always consult a qualified mathematician or statistician for high-stakes combinatorial analysis.