🎲 Permutations (nPr) & Combinations (nCr) Calculator

nPr and nCr with and without repetition — all four cases, in exact arbitrary precision, where most calculators cover two and break on large numbers.

Free No Signup Required Browser-Based
Combinations nCr (Order Does NOT Matter)
56
e.g. Committee groups, lottery picks
Permutations nPr (Order DOES Matter)
336
e.g. Passwords, race rankings
nCr = 8! / [3! × (8−3)!] = 56
nPr = 8! / (8−3)! = 336

If repetition is allowed

Combinations with repetition
120
(n+r−1)C r — e.g. scoops of ice cream
Permutations with repetition
512
nʳ — e.g. a PIN or a padlock code

8! has 5 digits. Factorials grow faster than almost anything else in elementary mathematics, which is why these counts explode so quickly.

What Permutations (nPr) & Combinations (nCr) Calculator Does

Everything in this area turns on two questions: does order matter, and can items repeat? Answer both and the formula is determined. Order matters and no repeats — that is a permutation. Order does not matter and no repeats — a combination. Allow repeats and each of those has a second form, which is where most calculators stop.

The distinction is easier with an example than a definition. Picking a captain and a goalkeeper from eleven players gives 110 outcomes, because choosing A then B is a different result from B then A. Picking two strikers from the same eleven gives 55, because the pair is the same pair whichever order you name them in. Combinations are always permutations with the redundant orderings divided out.

Repetition changes things more than people expect. A four-digit PIN has 10,000 possibilities, not 5,040, because digits can repeat — it is 10⁴ rather than 10P4. This is also why a combination lock is misnamed: the order you dial matters, so it is really a permutation lock, and one that permits repeated digits at that.

One practical note about these numbers. Factorials grow faster than almost anything else in elementary mathematics, and calculators built on ordinary floating-point arithmetic stop being exact at 20!. Past that they quietly round, and not far beyond they return Infinity. Everything here is computed in arbitrary precision, so a figure with sixty digits is correct in all sixty.

How to Use Permutations (nPr) & Combinations (nCr) Calculator

  1. Enter total number of elements n and sample subset size r (where r ≤ n)
  2. Review calculated combinations nCr and permutations nPr totals
  3. Inspect mathematical step-by-step factorial formulas

Formula Used by Permutations (nPr) & Combinations (nCr) Calculator

Permutations without repetition — order matters, no reuse

nPr = n! ÷ (n − r)!

n
Total number of distinct items available
r
How many you are arranging

Worked example

Choosing a captain and a goalkeeper from 11 players

  1. 11 choices for captain
  2. Once chosen, that person is unavailable, leaving 10 for keeper
  3. 11 × 10 = 110, which is 11! ÷ 9!

Result: 110 arrangements

Combinations without repetition — order irrelevant

nCr = n! ÷ [r! × (n − r)!]

r!
The number of orderings of the chosen items, divided out because they are all the same selection

Worked example

Choosing 2 strikers from the same 11 players

  1. Start from the 110 ordered arrangements
  2. A-then-B and B-then-A are the same pair, so each selection was counted 2! = 2 times
  3. 110 ÷ 2

Result: 55 selections

With repetition — the two cases most calculators omit

permutations = nʳ · combinations = (n + r − 1)C r

Each of the r positions independently has all n options available
(n+r−1)C r
The "stars and bars" result — distributing r identical picks across n categories

Worked example

A 4-digit PIN from the digits 0–9

  1. Order matters and digits may repeat
  2. 10 options for each of 4 positions
  3. 10 × 10 × 10 × 10

Result: 10,000 — against 5,040 if no digit could be reused

All four cases, decided by two questions

Choosing r items from n. Which formula applies depends only on whether order matters and whether items may repeat.

Order mattersOrder does not matter
No repetitionnPr = n! ÷ (n−r)!nCr = n! ÷ [r!(n−r)!]
Repetition allowed(n+r−1)C r
Example, n=6 r=230 · 36 with repetition15 · 21 with repetition
Typical usePINs, race places, rankingsCommittees, card hands, lottery

Worked values

Including the cases that come up most often.

ProblemFormulaAnswer
Arrangements of 1,2,3,4,5,66!720
Choose 2 from 55C210
5C35! ÷ [3!·2!]10 — identical to 5C2
Captain and keeper from 1111P2110
Two strikers from 1111C255
4-digit PIN, digits may repeat10⁴10,000
4 digits, no repeats10P45,040

Where floating-point calculators break

Exact values computed in arbitrary precision, against what a calculator using ordinary numbers returns.

ProblemExact answerFloating-point result
20C10184,756184,756 — still fine
50C25126,410,606,437,752Correct, but 50! itself is already inexact
100C501008913445455641933348124972561.0089134454556415e+29 — digits lost
200C10090548514656103281165404177077484163874504589675413336841320NaN
200P100A 217-digit integerInfinity

How to Read Your Result

The two questions, in order

Ask whether order matters first. If rearranging the same items gives a genuinely different outcome — a different password, a different podium — you want permutations. If it gives the same outcome — the same committee, the same hand of cards — you want combinations. Then ask whether an item can be picked twice. Drawing lottery balls without replacement cannot repeat; rolling dice or choosing PIN digits can. Those two answers pick the formula with no further judgement.

Why nCr is symmetric

5C3 and 5C2 are both 10, and that is not a coincidence. Choosing three items to take is the same act as choosing two to leave behind, so nCr always equals nC(n−r). This is worth knowing practically as well as conceptually: computing 100C97 as 100C3 involves three multiplications instead of ninety-seven, which is exactly the shortcut the calculation here uses.

Stars and bars

The formula for combinations with repetition, (n+r−1)C r, looks arbitrary until you see the argument behind it. Picture choosing 3 scoops from 5 flavors as laying out 3 stars and 4 dividers in a row: the dividers separate the flavors, and where the stars fall decides how many scoops of each. Every arrangement of stars and bars is one valid selection, and counting those arrangements gives the formula directly.

How fast these numbers grow

10! is about 3.6 million. 20! is roughly 2.4 quintillion. 100! has 158 digits and 170! is the largest factorial an ordinary double-precision number can hold at all — 171! overflows to infinity. This is why brute-force search over permutations becomes impossible so abruptly: an eight-item problem has 40,320 orderings, but a twenty-item problem has more orderings than there are grains of sand on Earth.

The lottery, honestly

A draw of 6 numbers from 49 without repetition and without regard to order is 49C6, just under 14 million. Buying a second ticket doubles your chance from one in fourteen million to two, which is a 100% improvement and still essentially zero. Combinatorics is very good at showing why intuition about large sample spaces is unreliable.

Limitations & Accuracy Notes

  • Inputs are capped at n and r of 2,000. The arithmetic is exact but the numbers become impractically long well before that — 2000! has over 5,700 digits.
  • Without repetition, r cannot exceed n; you cannot choose more distinct items than exist. With repetition it can, and the tool reports the with-repetition figures in that case while marking the others as undefined.
  • These formulas assume every item is distinguishable. Counting arrangements of a word with repeated letters is a different calculation — multiset permutations divide by the factorial of each repeat count.
  • Combinations with repetition assume the items themselves are interchangeable within a category. Three scoops of vanilla is one outcome, not three.
  • Counting how many outcomes exist says nothing about whether they are equally likely. Probability needs the count and the distribution; this tool provides only the count.

Frequently Asked Questions

What is the difference between a permutation and a combination?
Order. Permutations count arrangements where sequence matters — race finishes, passwords, who is captain and who is keeper. Combinations count selections where it does not — a hand of cards, a committee, lottery numbers. There are always at least as many permutations as combinations, because every combination can be shuffled into several orderings. From 11 people, choosing 2 gives 110 permutations but only 55 combinations.
What are the formulas?
Without repetition, nPr = n! ÷ (n−r)! and nCr = n! ÷ [r! × (n−r)!]. With repetition, permutations become simply nʳ, and combinations become (n+r−1)C r. Most calculators for this term implement only the first two — the top result states three separate times that it does not handle the repetition cases.
How many 4-digit PIN codes are there?
10,000. There are ten digits, four positions, order matters and digits may repeat, so it is 10⁴. If digits could not repeat it would be 10P4 = 5,040 instead. This is also why a “combination lock” is misnamed: the order you dial matters, which makes it a permutation lock.
What is 5C3?
10. Using the formula, 5! ÷ [3! × 2!] = 120 ÷ 12 = 10. Note that 5C3 and 5C2 both equal 10 — choosing 3 items to keep is the same as choosing 2 to leave behind, so nCr always equals nC(n−r).
Why do other calculators fail on large numbers?
Because they compute n! as an ordinary floating-point number, which stops being exact past 20!. By n=200 that approach returns Infinity for nPr and NaN for nCr. This tool uses arbitrary-precision integers and a multiplicative form that never builds the huge intermediate factorial, so 200C100 comes back exactly as 90548514656103281165404177077484163874504589675413336841320.
How much larger is a permutation than the matching combination?
By a factor of r factorial, where r is how many you are choosing — because every selection can be arranged that many ways. Choosing 3 from 10 gives 120 combinations and 720 permutations, exactly six times more.
Which one is a lottery?
A combination, because the order the balls are drawn in does not affect whether you win. Treating it as a permutation overstates the number of outcomes enormously and gives the wrong odds.
Is a "combination lock" really a combination?
No — it is a permutation, since the order of the digits absolutely matters. The everyday name is mathematically backwards, and it is the clearest illustration of why the distinction is worth keeping straight.
Why does zero factorial equal one?
Because there is exactly one way to arrange nothing — the empty arrangement. Defining 0! as 1 is also what makes the permutation and combination formulas work at their boundaries rather than dividing by zero.
What is the difference between with and without replacement?
Whether an item can be chosen twice. Drawing cards without replacement reduces the pool each time; rolling a die replaces it every roll. The formulas differ, and assuming the wrong one is a routine source of incorrect probabilities.
Is my data stored?
No. The calculation runs in your browser.

References & Further Reading

By OnlineToolHubs Team • September 2026