Combination Calculator

Enter your total items (n) and how many you're choosing (r). Pick combinations if order does not matter, permutations if it does, or see both side by side with every step shown.

Put this calculator on your website for free

Copy one snippet and give your visitors a working Combination Calculator.

Does order matter? Answer that first

Before you touch a formula, ask yourself one question: if I picked the same items in a different order, would it count as a different result? A poker hand is a combination: ace, king, queen, jack, ten is the same hand no matter which card landed in your hand first. A podium finish is a permutation: gold, silver, bronze is a completely different outcome from bronze, silver, gold, even though it's the same three runners. Get that one question right and the rest of this page is just arithmetic.

The two formulas

Combinations (nCr) count groups: order thrown out. Permutations (nPr) count arrangements: order kept.

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

You never need to compute a full factorial by hand. Both formulas collapse to the same trick: n! divided by (n - r)! cancels down to just the r numbers counting down from n. For 52 items choosing 5, 52! / 47! cancels to 52 x 51 x 50 x 49 x 48, six enormous factorials reduced to one short multiplication. For nCr, divide that product by r! on top of the cancellation; for nPr, you're already done.

Worked example: the 6/49 lottery

A lottery draws 6 numbers from 49, and the order they're pulled in doesn't change whether you win, so this is a combination: C(49,6).

Cancel the factorials: 49! / 43! = 49 x 48 x 47 x 46 x 45 x 44 = 10,068,347,520.

Divide by 6! = 720 to remove the orderings: 10,068,347,520 / 720 = 13,983,816.

That's the real math behind "your odds of winning are about 1 in 14 million." One ticket, one shot at 1 of 13,983,816 equally likely combinations.

When does order matter? A quick decision guide

SituationOrder matters?Use
Picking a 5-card poker handNoCombination
Choosing 3 pizza toppingsNoCombination
Setting a 4-digit PINYesPermutation
Ranking a race podium (1st, 2nd, 3rd)YesPermutation
Picking a committee of 5 peopleNoCombination
Assigning president, secretary, and treasurer from a groupYesPermutation

One more wrinkle: combinations with repetition

Both formulas above assume you can't pick the same item twice, which covers cards, lottery balls, and committee seats. If repeats are genuinely allowed and order still doesn't matter, such as choosing 3 scoops of ice cream from 5 flavors where you're free to repeat a flavor, the count is C(n + r - 1, r) instead, a related but different formula this calculator doesn't run directly. Most real counting problems, from card hands to lottery tickets to committees, don't allow repeats, which is why that's the default here.

Want to explore the odds themselves rather than just the count? Our probability calculator and dice roller pick up where a raw combination count leaves off. If lottery odds got you here, our annuity payout calculator has a lottery mode for the fun part, spending the winnings. And if percentages are what you actually needed, the percentage calculator is one click away.

Frequently asked questions

What is the difference between a combination and a permutation?

A combination counts groups where order does not matter (a hand of cards, a committee). A permutation counts arrangements where order does matter (a race podium, a PIN code). Same n and r, different answer: combinations are always smaller or equal because they collapse every reordering of a group into one count.

How do you calculate nCr by hand?

Use nCr = n! divided by (r! times (n minus r)!), but skip computing full factorials. Multiply the r numbers counting down from n, then divide by r!. For C(49,6), that is (49 x 48 x 47 x 46 x 45 x 44) divided by (6 x 5 x 4 x 3 x 2 x 1), which is 13,983,816.

What are the odds of winning a 6/49 lottery?

There are C(49,6) = 13,983,816 possible 6-number combinations, so a single ticket has a 1 in 13,983,816 chance of matching all six, roughly 0.0000072%. That count assumes no repeated numbers and that the order the balls are drawn in does not matter, which is how nearly every lottery works.

Does a poker hand use combinations or permutations?

Combinations. Being dealt ace, king, queen, jack, ten is the same hand as ten, jack, queen, king, ace: the order you received the cards in does not change what you hold. A 5-card hand from a 52-card deck has C(52,5) = 2,598,960 possibilities.

What is 0! and why does it matter here?

0! is defined as 1, not 0. That keeps the formulas consistent at the edges: C(n,0) = 1 (there is exactly one way to choose nothing) and C(n,n) = 1 (exactly one way to choose everything). Without 0! = 1, those edge cases would break.

Can r be larger than n?

No, not for these formulas. You cannot choose 10 items from a group of 6, so both nCr and nPr equal 0 whenever r is greater than n. This calculator will tell you that plainly instead of showing an error.

What if repeats are allowed?

These formulas assume you cannot pick the same item twice. If repetition is allowed and order still does not matter, such as choosing scoops of ice cream where you can repeat a flavor, the count is C(n + r - 1, r) instead: a related but different formula this calculator does not compute directly.

Related calculators