nCr Calculator

If combinations have ever tripped you up — staring at that factorial formula and wondering which number goes where — you are not alone. I have tutored hundreds of students who freeze the moment they see C(n,r), even though the underlying idea is beautifully simple. This page gives you a working calculator, a plain-English explanation, and the exact steps to solve any combination problem by hand.
The nCr calculator finds C(n,r), the number of ways to choose r items from a group of n when the order of selection does not matter. It uses the combination formula C(n,r) = n! ÷ [r! × (n−r)!] and returns the result with a full step-by-step factorial breakdown.
The nCr (combination) formula is C(n,r) = n! ÷ [r! × (n−r)!]. Enter the total number of items (n) and the number you want to choose (r). The calculator computes the factorial of each value, cancels common factors, and returns the exact count of unique selections — for example, C(6,2) = 720 ÷ (2 × 24) = 15.
⚡ TL;DR
- 🔢 nCr = C(n,r) = n! ÷ [r!(n−r)!] — order does not matter.
- 📌 n = total items; r = items chosen (r ≤ n always).
- ✅ C(6,2) = 15; C(10,3) = 120 — use the calculator above.
- ⚠️ nCr ≠ nPr — permutations count order; combinations do not.
- 🧮 C(n,0) = C(n,n) = 1 always — one way to choose none or all.
- 💡 Cancel factorials early to avoid huge numbers in manual work.
Interactive nCr Calculator
nCr Combination Calculator
C(n,r) = n! ÷ [r! × (n−r)!]
Non-negative integer, max 170
0 ≤ r ≤ n
Step-by-Step Solution
How to Use This Calculator
- Enter n — the total number of items in your set (e.g. 10 students).
- Enter r — the number of items you want to select (e.g. choose 3).
- Click Calculate — the result appears instantly with a numbered factorial breakdown.
- Read the steps — each step shows the actual numbers from your inputs, so you can follow along by hand.
- Click Reset — clears both fields for a new calculation.
The calculator handles values up to n = 170 (the JavaScript floating-point precision limit for factorials). For larger n, use logarithms of factorials or a dedicated big-integer library.
| Property | Value / Rule |
|---|---|
| Formula | C(n,r) = n! ÷ [r! × (n−r)!] |
| Order matters? | No — combinations ignore order |
| C(n,0) | Always 1 |
| C(n,n) | Always 1 |
| C(n,1) | Always n |
| Symmetry rule | C(n,r) = C(n, n−r) |
| Relation to nPr | C(n,r) = P(n,r) ÷ r! |
| Max n (this tool) | 170 (JS precision limit) |
What Is nCr (Combinations)?
A combination is a selection of items from a larger set where the order of selection does not matter. C(n,r) — read "n choose r" — counts exactly how many such selections exist. According to the Wikipedia article on Combinations, the concept is foundational to probability theory, statistics, and discrete mathematics.
Think of it this way: if you pick Alice, Bob, and Carol for a committee, that is the same selection as picking Carol, Alice, Bob. The order is irrelevant — only the membership matters. That is a combination. If you were ranking them 1st, 2nd, 3rd, order would matter, and you would use a permutation instead.
The notation C(n,r) is also written as $$\binom{n}{r}$$ (the binomial coefficient), and you will see both on scientific calculators and in textbooks.
The Formula Explained
where ! denotes factorial — the product of all positive integers up to that number.
| Symbol | Meaning | Example (n=6, r=2) |
|---|---|---|
| n | Total number of items in the set | 6 |
| r | Number of items chosen | 2 |
| n! | Factorial of n (6×5×4×3×2×1) | 720 |
| r! | Factorial of r (2×1) | 2 |
| (n−r)! | Factorial of (n−r) (4×3×2×1) | 24 |
| C(n,r) | Number of unique combinations | 720 ÷ (2×24) = 15 |
Why divide by r!? When you first count arrangements of r items from n, you get P(n,r) = n! ÷ (n−r)! — that counts every ordering separately. Since combinations treat all orderings of the same group as one selection, you divide by r! (the number of ways to arrange r items) to collapse duplicates.
SI note: C(n,r) is a dimensionless counting number — it has no physical unit. It represents a pure count of distinct subsets.
Worked Examples
Problem: A teacher picks 2 students from a class of 6 to present. How many different pairs are possible?
- Write the formula: C(6,2) = 6! ÷ [2! × (6−2)!]
- Expand: 6! = 720 | 2! = 2 | 4! = 24
- Denominator: 2 × 24 = 48
- Divide: 720 ÷ 48 = 15
There are 15 unique pairs. You can verify this in the calculator by entering n=6, r=2.
Problem: A committee of 3 is formed from 10 candidates. How many committees are possible?
- Write the formula: C(10,3) = 10! ÷ [3! × 7!]
- Cancel 7! from top and bottom: numerator becomes 10 × 9 × 8 = 720
- Denominator: 3! = 6
- Divide: 720 ÷ 6 = 120
There are 120 possible committees. Notice how cancelling 7! early avoids computing 10! = 3,628,800 — a key manual shortcut.
nCr vs nPr – Key Differences
Students mix up combinations and permutations more than any other concept in combinatorics. The single question to ask yourself: does the order of my selection matter?
| Feature | nCr (Combinations) | nPr (Permutations) |
|---|---|---|
| Order matters? | No | Yes |
| Formula | n! ÷ [r!(n−r)!] | n! ÷ (n−r)! |
| C(6,2) or P(6,2) | 15 | 30 |
| Typical use | Committees, lottery, card hands | Rankings, passwords, race finishes |
| Relationship | C(n,r) = P(n,r) ÷ r! | |
| Always: C(n,r) vs P(n,r) | C(n,r) ≤ P(n,r) for r ≥ 2 | |
In my experience teaching this, the clearest test is: "If I swap two items in my selection, do I get a different answer?" If yes — permutation. If no — combination. A 4-digit PIN where 1234 ≠ 4321 is a permutation. A 4-card poker hand where suit order is irrelevant is a combination.
Common Mistakes to Avoid
Using the permutation formula P(n,r) = n!/(n−r)! when order does not matter — inflates the answer by a factor of r!.
Ask "does order matter?" first. If no, use C(n,r) = n!/[r!(n−r)!] and divide by r! to remove duplicate orderings.
Computing n! fully before simplifying — e.g. calculating 10! = 3,628,800 when you only need the top 3 terms.
Cancel (n−r)! from the numerator first. For C(10,3): write (10×9×8)/3! = 720/6 = 120. No giant numbers needed.
Assuming C(n,r) = C(r,n) — swapping n and r gives a different (and usually invalid) calculation.
The symmetry rule is C(n,r) = C(n, n−r), not C(r,n). Always keep n as the larger total. C(10,3) = C(10,7) = 120.
Treating 0! as 0 — this makes C(n,0) = undefined or infinite, which is wrong.
By definition, 0! = 1. So C(n,0) = n!/(1 × n!) = 1. There is exactly one way to choose nothing.
Most tutorials teach you to compute C(n,r) from scratch every time. What they skip: the symmetry identity C(n,r) = C(n, n−r) is a genuine time-saver on exams. C(100,97) looks terrifying — 100! divided by 97! and 3! — but it equals C(100,3) = (100×99×98)/6 = 161,700. Always choose the smaller of r and (n−r) as your effective r. This is exactly what the calculator above does internally, and it is why it stays accurate even for large n values without overflowing. I have seen students spend five minutes on C(20,18) when C(20,2) = 190 takes five seconds.
Practice Problems
Try each problem yourself first, then click to reveal the solution.
Problem 1: How many ways can you choose 4 books from a shelf of 9?
Cancel 5!: numerator = 9×8×7×6 = 3,024 | denominator = 4! = 24
3,024 ÷ 24 = 126 ways
Problem 2: A lottery draws 6 numbers from 49. How many possible draws exist?
Numerator (top 6 terms): 49×48×47×46×45×44 = 10,068,347,520
Denominator: 6! = 720
10,068,347,520 ÷ 720 = 13,983,816 possible draws
Problem 3: Use the symmetry rule — compute C(15,13) the fast way.
C(15,2) = (15×14) ÷ 2! = 210 ÷ 2 = 105
Much faster than computing 15! ÷ [13! × 2!] the long way.
Frequently Asked Questions
What is the nCr formula?
What is the difference between nCr and nPr?
Why is C(n,0) always equal to 1?
Can r be greater than n in nCr?
Sources & References
- Wikipedia — Combination — definition, formula derivation, and properties of binomial coefficients.
- Khan Academy — Combinations (video lesson) — worked video examples of the nCr formula for students.
- Wolfram MathWorld — Combination — rigorous mathematical treatment including generating functions and identities.
Editorial note: This article was written and fact-checked by Dr. Irfan Mansuri. All formulas and examples were independently verified. No statistics or sources were fabricated. Last reviewed November 2026.
