Skip to content

Combination Calculator

Enter the total number of items (n) and how many you pick (r), then say whether order matters.

Does order matter?
C(n, r)–
Combinations C(n, r)–
Permutations P(n, r)–
Combinations with repetition–
Permutations with repetition (nʳ)–

Updated: December 1, 2026Sources and method ↓

How do you calculate combinations?

A combination counts the ways to choose r items from n when order doesn’t matter. Picking Ann, Ben and Cal for a committee is the same choice as Cal, Ann and Ben. The formula, often read “n choose r,” is:

C(n, r) = n! ÷ (r! × (n − r)!)

Here n! (“n factorial”) means n × (n − 1) × … × 1, and 0! is defined as 1.

Example: A pizza place offers 10 toppings and you can pick 3. C(10, 3) = 10! ÷ (3! × 7!) = (10 × 9 × 8) ÷ (3 × 2 × 1) = 120 different pizzas.

How do you calculate permutations?

A permutation counts ordered arrangements. Gold–silver–bronze is different from bronze–silver–gold, so each choice of r items gets counted once for every possible order:

P(n, r) = n! ÷ (n − r)!

Example: Eight runners compete for gold, silver and bronze. P(8, 3) = 8 × 7 × 6 = 336 possible podiums. Only C(8, 3) = 56 different groups of three can make the podium, and each group can be arranged in 3! = 6 orders: 56 × 6 = 336.

That relationship always holds: P(n, r) = C(n, r) × r!.

Combination or permutation? A quick test

Ask: “If I shuffle the chosen items, do I get a different outcome?” If yes, order matters and you want a permutation. If no, it’s a combination.

SituationOrder matters?Use
Lottery numbersNoCombination
5-card poker handNoCombination
Race finishing positionsYesPermutation
Club president, VP, treasurerYesPermutation
4-digit PIN (digits can repeat)YesPermutation with repetition: 104 = 10,000

A combination lock is, mathematically, a permutation lock: 1-2-3 and 3-2-1 don’t both open it.

With repetition

Sometimes the same item can be picked more than once.

  • Permutations with repetition (order matters, repeats allowed): nʳ. A 4-digit PIN has 104 = 10,000 possibilities.
  • Combinations with repetition (order doesn’t matter, repeats allowed): C(n + r − 1, r). Choosing 3 scoops from 5 ice-cream flavors, where two scoops can be the same flavor, gives C(7, 3) = 35 options.

A handy shortcut: choosing who’s left out

Choosing r items to keep is the same as choosing n − r items to leave out, so C(n, r) = C(n, n − r). Picking 8 players from 10 for a team gives the same count as picking the 2 who sit out: C(10, 8) = C(10, 2) = 45. When r is close to n, use the smaller number; the arithmetic is far shorter. It’s also why the numbers in each row of Pascal’s triangle read the same forwards and backwards.

Combinations and lottery odds

Lottery odds are a combination problem, because the order the balls are drawn doesn’t matter. In Powerball you pick 5 numbers from 1 to 69 and one Powerball from 1 to 26. That’s C(69, 5) × 26 = 11,238,513 × 26 = 292,201,338 possible tickets, so a single ticket has a 1 in 292,201,338 chance of the jackpot. Try n = 69, r = 5 above to see the first part. The lottery odds calculator works out every prize tier, and the birthday paradox shows how combinations make shared birthdays surprisingly likely.

Very large numbers

Factorials grow incredibly fast: 20! is already about 2.4 quintillion, and 52! (the number of ways to shuffle a deck of cards) has 68 digits. This calculator uses exact whole-number arithmetic, so even huge results are correct to the last digit. When a result is longer than 24 digits it’s shown in scientific notation, with every digit available underneath. To write a result out in English, paste it into the number to words converter.

Frequently asked questions

What is the formula for combinations?
C(n, r) = n! ÷ (r! × (n − r)!). For example, choosing 3 from 10 gives 10! ÷ (3! × 7!) = 120.
What is the difference between a combination and a permutation?
In a combination order doesn’t matter; in a permutation it does. Choosing 3 people from 8 gives 56 combinations, but 336 permutations if the three get different roles.
How many combinations of 4 numbers are there?
With digits 0–9 and repeats allowed, as in a PIN, there are 10^4 = 10,000. Choosing 4 different numbers from 0–9 where order doesn’t matter gives C(10, 4) = 210.
What does nCr mean on a calculator?
nCr is “n choose r,” the number of combinations of r items from n. nPr is the matching permutation count, where order matters.
Why is 0! equal to 1?
There is exactly one way to arrange zero items: do nothing. Defining 0! = 1 also keeps formulas like C(n, n) = 1 and C(n, 0) = 1 working.

Sources: Standard combinatorics formulas. Powerball format (5 of 69 plus 1 of 26): Multi-State Lottery Association (powerball.com). Results computed with exact integer (BigInt) arithmetic.

Last updated: December 1, 2026

Results are for information only. For official or financial decisions, consult a qualified professional.

You might also need