How to use the combination calculator
- Enter a whole number in Number of items (n).
- Enter a whole number in Number chosen (r).
- Choose No repetition or Allow repetition.
- Click Calculate to show the result and the short Formula & steps list.
- Use Copy result or Download result (.txt) to save the output.
- Click Reset to clear both inputs, restore No repetition, hide errors, and hide the current result.
What the calculator calculates
The calculator computes combinations, written nCr or C(n, r). Order does not matter, so choosing A then B is the same selection as choosing B then A.
- Number of items (n): a whole number from 0 through 10,000.
- Number chosen (r): a whole number from 0 through 10,000.
- No repetition: each item can be chosen at most once, and
rcannot exceedn. - Allow repetition: the same item can be chosen more than once.
Formulas and edge cases
For No repetition, the formula is C(n, r) = n! / (r! × (n - r)!). For Allow repetition, it generally uses C(n + r - 1, r). If r = 0, the result is 1 in both modes. With Allow repetition, n = 0 and r > 0 returns 0. With No repetition, that input is rejected because r exceeds n.
The result panel shows a short Given, Formula, symmetry or edge-case, and final-result sequence. It does not list every loop calculation used internally.
Combinations versus permutations
Use combinations when order does not matter. Use permutations when different orders count as different outcomes.
Limits and copying results
Both fields must contain whole numbers from 0 through 10,000. Empty, non-numeric, or out-of-range values show an error instead of a result. With No repetition, r must not exceed n.
The arithmetic runs in the browser from the values you enter. The page also loads shared analytics scripts. Clipboard copying may fail in some environments; the tool can show Could not copy - select and copy manually. You can still use Download result (.txt).
Frequently Asked Questions
What is a combination in math?
A combination is a selection of items from a larger set where the order of selection does not matter. Choosing 3 people from a group of 10 for a committee is a combination, because the same 3 people form the same committee no matter what order they are picked in.
What is the formula for combinations (nCr)?
Without repetition, the formula is C(n, r) = n! / (r! × (n - r)!). With repetition, it is generally C(n + r - 1, r); r = 0 returns 1 in both modes. With Allow repetition, n = 0 and r > 0 returns 0; with No repetition, that input is rejected because r exceeds n.
What is the difference between a combination and a permutation?
A combination ignores order (choosing items A and B is the same as choosing B and A), while a permutation counts different orderings as distinct outcomes. Combinations are always less than or equal to the corresponding permutations for the same n and r.
What happens when r = 0 or n = 0?
The result is 1 when r = 0 in both modes. With Allow repetition, n = 0 and r > 0 returns 0 because no items are available. With No repetition, the same input is rejected because r exceeds n.
What input values are supported?
Number of items (n) and Number chosen (r) must be whole numbers from 0 through 10,000. With No repetition, r must be less than or equal to n.