Combinations Calculator: Your Math Helper

What are combinations?

Combinations calculate how many ways you can choose items where order doesn't matter. For example, choosing 2 fruits from {apple, banana, orange} gives 3 combinations: {apple, banana}, {apple, orange}, {banana, orange}.

Combinations vs Permutations:

  • Combinations: Order doesn't matter (AB = BA)
  • Permutations: Order matters (AB ≠ BA)

Need permutations instead? Click here for permutations calculator

Input requirements:

  • Both n and r must be non-negative integers
  • r cannot be greater than n (can't choose more items than available)
  • Maximum recommended value: 170 (to avoid overflow)

Worked example: choosing 3 from 10

Enter n = 10, r = 3. The calculator applies C(n,r) = n! / (r! × (n−r)!):

C(10,3) = 10! / (3! × 7!)
        = 3,628,800 / (6 × 5,040)
        = 3,628,800 / 30,240
        = 120

There are 120 distinct ways to pick 3 items from a set of 10 when order doesn't matter. To verify against the formula independently: the calculator's optimized loop computes this as (10×9×8)/(3×2×1) = 720/6 = 120, avoiding the full factorial of 10 for speed — same answer, smaller intermediate numbers.

Why the tool caps n at 170

170! is roughly 7.26 × 10³⁰⁶, right at the edge of what a JavaScript double-precision float can represent before overflowing to Infinity. 171! would already break the factorial-string display, so the input is capped there rather than silently returning wrong numbers for very large n.

Combinations vs. permutations, concretely

If you're choosing 2 letters from {A, B, C}, combinations treats {A,B} and {B,A} as the same outcome — 3 total: AB, AC, BC. Permutations would count AB and BA separately, giving 6 total. Use this calculator when the selection order truly doesn't matter, such as picking a 3-person committee from 10 candidates (no ranking of who's "first").

Edge cases worth knowing

C(n,0) always equals 1 (there's exactly one way to choose nothing), and C(n,n) also equals 1 (one way to choose everything). Setting r larger than n returns a validation error, since you can't select more items than exist in the set.