Permutation and Combination Calculator
nPr and nCr, with and without repetition.
Work out Permutation and Combination. nPr and nCr, with and without repetition. Handles the boundary cases the shortcuts get wrong.
52C5 — combinations
2,598,960
311,875,200 permutations, where order matters
Order is the only difference between the two headline figures. There are 2,598,960 ways to select 5 from 52, and 311,875,200 ways to arrange them — exactly 120 times more, because each selection can itself be ordered in 5! ways. These are the poker hands: 2,598,960 distinct five-card hands from a standard deck.
How the Permutation and Combination Calculator works
Permutations count arrangements and combinations count selections — the difference is whether order matters. Choosing five cards from a deck gives 2,598,960 combinations, the number of distinct poker hands, but 311,875,200 permutations, because each hand can be dealt in 120 different orders. Both are computed here, along with the versions that allow repetition.
Also known as: nCr calculator · nPr calculator · how many combinations calculator · combinations without repetition
The calculation itself
nCr = n! ÷ (r! × (n − r)!) counts selections, where order does not matter. nPr = n! ÷ (n − r)! counts arrangements, where it does.
They differ by exactly r!, because every selection of r items can itself be ordered in r! ways. That single factor is the whole distinction between the two.
In practice
Five cards from a standard deck: 2,598,960 combinations and 311,875,200 permutations. The ratio is 120, which is 5! — the number of orders a single hand can be dealt in.
Six numbers from 49: 13,983,816 combinations. That is the odds of a lottery jackpot, and stating it as one in fourteen million is more honest than any smaller-sounding rearrangement of the same figure.
With repetition allowed the numbers change shape entirely. Three dice give 6³ = 216 ordered outcomes; two scoops from four ice cream flavours, where a double scoop of one flavour counts, give 10 rather than 6.
Why the naive formula fails
Computing 52C5 from three factorials means evaluating 52!, a number with 68 digits. It overflows ordinary floating point long before the division brings it back down.
The answer, 2,598,960, is small. So this computes it multiplicatively — multiplying and dividing term by term so the running value never grows large — and uses the smaller of r and n−r, since nCr equals nC(n−r).
It is a small implementation detail with a real consequence: the naive method fails on precisely the deck-of-cards and lottery cases that people come to a combinations calculator to work out.
Frequently asked questions
What is the difference between a permutation and a combination?
Order. A combination is a selection: choosing Alice, Bob and Carol for a committee is one combination however you list them. A permutation is an arrangement: first, second and third place are six different permutations of the same three people.
How do I calculate nCr?
n! ÷ (r! × (n − r)!). In practice it is computed multiplicatively rather than from three factorials, because 52! overflows any ordinary number type while 52C5 is only 2,598,960 — the naive method fails on exactly the cases people want to count.
How do I calculate nPr?
n! ÷ (n − r)!, which is the product of the r largest terms: 5P2 = 5 × 4 = 20. It is always r! times larger than the corresponding combination.
How many 5-card poker hands are there?
2,598,960. That is 52 choose 5, and it is the standard worked example for combinations because the deck is familiar and the number is large enough to be surprising.
What are combinations with repetition?
Selections where the same item can be chosen more than once — like picking two scoops of ice cream from four flavours, where two of the same is allowed. The formula is (n + r − 1) choose r, giving 10 rather than 6.
Why is nCr equal to nC(n−r)?
Because choosing which r items to include is the same act as choosing which n−r to leave out. Picking 3 from 10 and picking 7 from 10 both give 120.
Put this calculator on your own site
Free to use, on any site, commercial or not. Paste this where you want it to appear. It is a plain iframe, so it works in WordPress, Squarespace, Wix, Webflow, Ghost and anything else that accepts HTML.
<iframe src="https://www.thecalclibrary.com/embed/permutation-combination-calculator" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px" loading="lazy" title="Permutation and Combination Calculator"></iframe>The only condition is that the credit line stays visible. It sits inside the frame, so you do not have to do anything to keep it.
Related calculators
Probability Calculator
Two events combined, and the odds over repeated trials.
OpenDice Roller
Takes real dice notation, including keep-highest for character rolls.
OpenRandom Number Generator
Pick a range, get numbers nobody can predict.
Open