Combinations Calculator

In short: there are exactly 2,598,960 five-card poker hands — C(52, 5) — and this calculator counts combinations and permutations exactly, however many digits the answer runs to.

Counting selections and arrangements

Combinatorics is the mathematics of counting choices, and its two workhorse questions are the combination and the permutation. A combination C(n, r) counts the ways to choose r items from n when order does not matter — hands of cards, committees, lottery tickets, pizza toppings. A permutation P(n, r) counts the ways when order does matter — race finishes, podium places, codes and rankings. Both are built from factorials: C(n, r) = n! / (r! (n − r)!) and P(n, r) = n! / (n − r)!. This page also gives the two with-repetition variants, for choices where an item can be picked again: C(n + r − 1, r) selections and n^r arrangements. All four are computed exactly with BigInt integer arithmetic, so even results with hundreds of digits are printed digit-perfect rather than rounded into scientific notation.

The counts grow with startling speed, which is the real lesson of the subject. Choosing 5 cards from 52 gives over two and a half million hands; choosing 6 numbers from 49 gives nearly fourteen million lottery combinations; arranging just 10 finalists in order gives over 3.6 million permutations of the full set. That growth is why brute force fails so often in computing and why "just try every combination" stops working almost immediately — and, on the brighter side, why a modest password alphabet and length produce a search space no one can enumerate. The formulas here are the standard ones found in every combinatorics text since Pascal's triangle made the combination numbers visual in the 1600s: each C(n, r) is literally an entry of that triangle.

Worked examples

Poker hands: C(52, 5) = 2,598,960. Fifty-two cards, five in a hand, order irrelevant. Every poker probability is a count of favourable hands divided by this number.

Podium places: P(10, 3) = 720. Ten finalists, three ordered places: 10 × 9 × 8 = 720. The same three finalists as an unordered selection give C(10, 3) = 120 — the factor between them is 3! = 6, the orderings of three people.

Ice cream with repetition: 10 flavours, 3 scoops, repeats allowed: C(10 + 3 − 1, 3) = C(12, 3) = 220. And arranging 5 distinct items in a row, P(5, 5) = 5! = 120.

Does order matter? A decision guide

SituationOrder matters?Use
Poker hand, committee, lottery ticketNoC(n, r)
Race finish, ranking, PIN digitsYesP(n, r) or n^r
Ice-cream scoops, drinks refills (repeats allowed)NoC(n + r − 1, r)
Passwords and codes (repeats allowed)Yesn^r

The one-question test: swap two of the chosen items in your head. If the outcome is genuinely different — a different winner, a different code — order matters and you want a permutation. If the swap changes nothing — the same hand, the same committee — it is a combination. Most real counting mistakes are not arithmetic at all; they are this decision made wrongly, and they are off by exactly a factor of r!.

Rules and notes

Both n and r must be whole numbers, and for the ordinary combination and permutation r cannot exceed n — the calculator explains rather than errors when it does. Edge cases follow the standard conventions: choosing nothing (r = 0) gives exactly 1 in every variant, and choosing everything gives C(n, n) = 1 but P(n, n) = n!. Exactness has a practical limit only in display patience: C(1000, 500) is a 300-digit number and will be printed in full. If you need probabilities rather than counts, divide the favourable count by the total count — the probability calculator linked below takes it from there.

Frequently asked questions

What is the difference between a combination and a permutation?

Whether order matters. A permutation counts arrangements: the podium finish 1st, 2nd, 3rd treats A-B-C and C-B-A as different outcomes. A combination counts selections: a committee or a poker hand is the same whichever order its members were picked in. That is why C(10, 3) = 120 but P(10, 3) = 720 — exactly 3! = 6 times larger, one for each ordering of the same three people.

How many five-card poker hands are there?

C(52, 5) = 2,598,960. A standard deck has 52 cards, a hand is 5 of them, and the order in which they were dealt does not change the hand, so it is a combination. That single number underlies all poker probability: a royal flush is 4 of those hands (one per suit), so its probability is 4 / 2,598,960. This calculator reproduces the figure exactly, using whole-number arithmetic with no rounding.

What does 'with repetition' mean?

That each item can be chosen more than once — like a three-scoop ice-cream order from 10 flavours where triple chocolate is allowed. Combinations with repetition are counted by C(n + r − 1, r): for 10 flavours and 3 scoops that is C(12, 3) = 220, against 120 without repetition. The ordered version with repetition is simpler still: n^r, since every one of the r slots can be any of the n items.

Why does this calculator use exact whole-number arithmetic?

Because factorials explode. 52! has 68 digits, far beyond the exact range of ordinary floating-point numbers, and dividing two rounded giants can leave the final digits wrong. This page computes with BigInt, JavaScript's exact integer type, cancelling factors as it goes, so C(52, 5) comes out as exactly 2598960 rather than a nearby approximation. For very large n the exact answer can run to hundreds of digits, and it is printed in full.

Can r be larger than n?

Not for ordinary combinations and permutations: you cannot choose 6 different cards from 5, so C(n, r) and P(n, r) are zero — or rather, undefined as counts — when r exceeds n, and this calculator says so. With repetition allowed it is fine, because items can be reused: C(n + r − 1, r) and n^r both work for any r. And r = 0 always gives exactly 1: there is precisely one way to choose nothing.

Related tools

Formulas and worked examples last verified: 24 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.