Permutation and Combination Calculator
Enter n and r to get nPr (permutations, order matters) and nCr (combinations, order does not) exactly - with the formulas, the worked substitution, and the with-repetition variants.
- Free, no account
- No watermark
- No usage limit
About the Permutation & Combination Calculator
Type how many things you have (n) and how many you're picking (r), and you get four counts at once: permutations (nPr, order matters), combinations (nCr, order doesn't), and the two with-repetition versions most calculators leave off. Choose 2 from 5 and it shows nPr = 20 and nCr = 10, each with its formula and the real numbers plugged in so you can see where the answer came from. It all runs in your browser on exact big-integer math, so a result with sixty digits keeps all sixty, and nothing you type ever leaves your machine.
Four numbers instead of one, and that's the point. People treat "permutation or combination" as the only question when it's really two: does order matter, and can an item repeat. Get the pair wrong and the count can come out a whole factor too big, sometimes hundreds of times over. Most tools make you commit to one of the four before you've worked out which question you're asking, then hand back a lone number with no way to sanity-check it. Seeing all four together lets you reason backward from the counts to the one that fits your problem.
How to use
- Enter
n, the total pool you're choosing from. Eight people, 52 cards, six horses, whatever you've got. - Enter
r, how many you're pulling from that pool. Three officers, five cards, the top three finishers. - Read all four counts.
nPrandnCrsit up top with their formulas filled in. The two with-repetition boxes are right below them. - Tap a preset like
52,5to watch it work, or hit Clear to start over.
Put in an r bigger than n, say pick 5 from a set of 3, and you get a plain-English note instead of a wrong number or a NaN. You can't choose more distinct items than you have. Decimals and negatives get the same handling, since half a card or a negative number of people aren't real selections.
When order counts, and when it doesn't
Everything hinges on one call: does the order of your picks carry any meaning. Say you've got three friends, Ana, Ben, and Cara, and two concert tickets.
If both tickets are general admission, you're only choosing which two friends go. {Ana, Ben} is the same as {Ben, Ana}. Order means nothing here, so it's a combination, and there are 3 ways: {Ana, Ben}, {Ana, Cara}, {Ben, Cara}.
Now make one ticket front row and the other the back of the hall. Suddenly it matters who gets which. Ana-front with Ben-back is a different outcome from Ben-front with Ana-back. That's a permutation, and there are 6.
Same friends, same "choose 2 from 3", and you land on three answers or six depending only on whether order carries weight. A quick gut-check: if swapping the order of two picks gives you a genuinely different result, you want a permutation. If it doesn't, you want a combination. Podium finishes, seating orders, passwords, anything that's really an arrangement, are permutations. Teams and lottery tickets, where you just want the group and nobody's ranked, are combinations.
Where a pocket calculator gets it wrong
Your phone has an nCr button, and it works fine until the numbers get big. A calculator holds about 15 to 17 significant digits, then it rounds. Ask most of them for C(52, 26), the number of ways to split a deck into two 26-card halves, and you get back 4.959e14, which is rounded, not exact. The exact value is 495,918,532,948,104, and this tool gives you every digit, because it does whole-number arithmetic with no size ceiling. Past 20! or so a rounded answer is close but wrong, and close is no good when you're checking whether two counts match or feeding the number into a probability.
For a result too long to print, it switches to a digit count plus a rounded scientific reading, but the full exact integer is still what got computed, not rounded away to fit the screen. If you instead want the combination as one piece of a larger expression, like a binomial-probability term C(n, r) × p^r × (1-p)^(n-r), a scientific calculator is built to punch that whole chain through in one pass. This tool just gives you the exact count and the formula it used.
With repetition, the two counts others skip
Plain nPr and nCr both assume that once you pick something, it's gone. Draw a card and it's out of the deck. But loads of real problems let you reuse an item, and that's a different count, which is why this tool shows both repetition variants right under the main results.
Permutations with repetition are n^r. Every slot gets the whole pool back. A 4-digit PIN from 10 digits, where 1123 and 0000 are both allowed, is 10^4 = 10,000. Each position independently has all ten choices, so you multiply ten by itself four times. Passwords, license plates, anything where a symbol can show up twice, works this way, and it's the reason a long password beats a clever short one: length multiplies the pool by itself again for every character you add.
Combinations with repetition are C(n + r - 1, r), the least intuitive of the four. It answers "how many ways to pick r things from n types when you can take multiples and order doesn't matter". Three scoops of ice cream from five flavors, where two scoops of chocolate is fine and the scoops aren't ranked, is C(5 + 3 - 1, 3) = C(7, 3) = 35. The trap is reaching for plain nCr here, which gives C(5, 3) = 10 and misses every selection that repeats a flavor. So before you trust any count, ask two things, not one: does order matter, and can items repeat.
Frequently asked questions
Why is the permutation always bigger than the combination?
Because a permutation counts every ordering of the same group as its own result, where a combination counts that group only once. For any r items you pick there are r! ways to shuffle them (that's the factorial of r), so nPr is exactly nCr times r!. Choose 3 from 10 and you get 720 permutations against 120 combinations, and 720 / 120 is 6, which is 3!. They only come out equal at r = 0 or r = 1, where there's nothing left to reorder.
What does "combinations with repetition" actually count?
It's the count for handing identical items into labeled bins, or the same thing said differently, pulling r items from n types with repeats allowed and order ignored. Mathematicians call it stars and bars: line up r stars and n - 1 dividers, and every arrangement of that row is one valid selection. It shows up in questions like how many ways to split ten identical coins among four people. The ice cream example is the same count with flavors instead of coins.
Can `r` be 0, and what does that mean?
Yes, and both counts come back as 1. There's exactly one way to choose nothing, the empty pick, so nPr and nCr at r = 0 are both 1. The formulas agree, since everything reduces to n! / n! = 1, which also needs 0! to equal 1 for the arithmetic to hold together. Try the 8,0 preset to see it. The same logic gives C(n, n) = 1, one way to take the whole set, which is why r = 0 and r = n both land on 1.
Is `nCr` the same as "n choose r" or a binomial coefficient?
All three name the identical number. nCr, "n choose r", and the binomial coefficient (written as n stacked over r in tall parentheses) are one value. It's the coefficient you get expanding (a + b)^n, so C(5, 2) = 10 is also the coefficient of the a^3 b^2 term in (a + b)^5, and the 10 sitting in the middle of row 5 in Pascal's triangle. If a stats problem asks for a binomial coefficient, type the two numbers here and read the nCr line.
Why does the result sometimes show scientific notation and a digit count instead of the full number?
When an answer runs past 30 digits, printing every one would be a wall of digits nobody can read, so the tool shows a rounded scientific form plus how many digits the exact answer has. The exact integer is still what got computed, it's just too long to display in full. So a huge C(200, 100) tells you it's a 59-digit number near 9 × 10^58 without dumping the whole string in front of you.
How large can `n` get?
It caps n at 100,000. That's far past any real counting problem, and the cap is there so a careless entry doesn't lock up your tab building a thousand-digit integer nobody wanted. Inside that range every result is exact, digit for digit. If you genuinely need combinatorics on astronomically larger inputs, that's a job for a computer-algebra system rather than a quick web calculator, but for real-world n and r this handles it with room to spare.