combination formula calculator

Combination Calculator (nCr)

Enter two whole numbers to compute how many ways to choose r items from n items where order does not matter.

Result will appear here.
Formula: C(n, r) = n! / (r! × (n − r)!)

What is a combination?

A combination is a way of selecting items from a group where the order does not matter. For example, selecting 3 toppings for a pizza from 8 options is a combination problem, because choosing mushrooms, onions, and olives is the same set regardless of the order you list them.

The combination formula

The standard formula is:

C(n, r) = n! / (r!(n-r)!)

  • n = total number of items available
  • r = number of items selected
  • ! = factorial, meaning multiplication down to 1

This calculator computes the exact whole-number result using integer arithmetic, so you can handle both small and fairly large inputs with precision.

How to use this calculator

  1. Enter a whole number for n.
  2. Enter a whole number for r.
  3. Click Calculate nCr.

Constraints: both values must be non-negative integers, and r ≤ n. For performance, this page currently allows values up to 5000.

Examples

Example 1: Choosing 2 from 5

C(5,2) = 10. There are 10 unique pairs you can form from 5 items.

Example 2: Lottery-style pick

C(49,6) = 13,983,816. That means there are over 13 million possible 6-number combinations from 49 numbers.

Example 3: Card hands

C(52,5) = 2,598,960. This is the number of unique 5-card poker hands from a standard 52-card deck.

Combination vs. permutation

People often mix up combinations and permutations:

  • Combination: order does not matter (nCr)
  • Permutation: order matters (nPr)

If you care about ranking, sequence, or arrangement, use permutation. If you only care about the chosen set, use combination.

Where combinations are used in real life

  • Probability and statistics
  • Card and board game analysis
  • Lottery odds
  • Sampling in surveys and experiments
  • Feature selection in machine learning

Quick tips

  • If r = 0 or r = n, then C(n,r) = 1.
  • C(n,r) = C(n,n-r), so choosing 2 from 10 equals choosing 8 from 10.
  • Always validate that r is not greater than n.

🔗 Related Calculators