Combination Calculator

Calculate the number of combinations for a given set of items.

Runs locally in your browser

Your inputs are processed locally in your browser and are not uploaded or stored by us.

The Combination Calculator finds the number of ways to choose r items from a set of n items without regard to order.

How to calculate combinations

  1. Enter the total number of available items (n).
  2. Enter the number of items to select (r).
  3. Click "Calculate" to find the unordered groupings.

Combination Formula

nCr = n! / (r!(n-r)!)

Combinations ignore order; permutations count different orderings separately. Due to symmetry (nCr = nC(n-r)), the implementation uses that relationship to minimize internal work. The combination engine uses exact integer arithmetic internally and only returns a JavaScript number when the exact result fits within the safe-integer range.

Calculating 5C2

n (total items)5
r (selected items)2
5C2 = 5! / (2!(5-2)!) = 10
Result: 10

Notes

  • Inputs must be safe integers where n >= 0, r >= 0, and r <= n.
  • Examples include nC0 = 1, nCn = 1, and 100C1 = 100.
  • If the exact result exceeds the JavaScript safe-integer range, the calculator safely rejects the calculation instead of outputting an approximate representation.
  • The calculator preserves exact integer relationships within its documented limits.
  • Your inputs are processed locally in your browser and are not uploaded or stored by us.