Combination Calculator (nCr)
Calculate the number of combinations of n items taken r at a time (nCr).
Did this tool answer your question?
Thanks — this helps us improve the tool.
How to use this tool
- Enter n (total items) and r (items chosen) in the fields above.
- Results update instantly as you type — or click Calculate.
- Read your ncr and the full breakdown beneath it.
nCr = n! / (r! × (n−r)!) counts unordered selections of r items from n.
Formula
nCr = n! ÷ (r! × (n − r)!)
Computed iteratively: numerator = n × (n−1) × … × (n−r+1), denominator = r!, then nCr = numerator ÷ denominator. The smaller of r and n−r is used to minimise steps.
How it works
This calculator counts the number of unordered subsets of size r that can be chosen from n distinct items. Unlike permutations, the order of selection does not matter: {A, B} and {B, A} count as one combination. The algorithm uses the smaller of r and n−r to keep the loop short, and builds the numerator and denominator in parallel to maintain integer precision throughout.
Worked example
- n = 5 (total items), r = 2 (items chosen).
- Because r (2) ≤ n − r (3), keep r = 2.
- Numerator: 5 × 4 = 20.
- Denominator: 1 × 2 = 2.
- nCr = 20 ÷ 2 = 10.
nCr = 10 combinations.
Common mistakes to avoid
- Using nCr when order matters (e.g. assigning ranked prizes); that requires nPr, not nCr.
- Forgetting that nCr = nC(n-r), so C(10,7) = C(10,3); using the larger r unnecessarily inflates intermediate calculations.
- Setting r = 0 and being surprised the result is 1; there is exactly one way to choose nothing from any set.
Key terms
- Combination
- A selection of items where order does not matter. Choosing {A, B} is the same as choosing {B, A}.
- n (total items)
- The total number of distinct items in the pool.
- r (items chosen)
- The number of items selected to form each subset.
- Binomial coefficient
- Another name for nCr. It appears as coefficients in the binomial theorem expansion of (a+b)ⁿ.
- Symmetry property
- nCr = nC(n−r). Choosing 2 from 5 gives the same count as choosing 3 from 5, both equal 10.
Frequently asked questions
- What is a combination?
- A combination is an unordered selection. nCr = n!/(r!(n-r)!). For example, C(5,2) = 10 — choosing 2 from 5 ignoring order.