Combinations Counter

Count the number of ways to arrange or choose things. Enter how many items you have (n) and how many slots to fill (r), then set the two toggles — the calculator picks the right formula from permutations, combinations and their repetition-allowed cousins.

Order matters?
Repetition allowed?
Formula selected: n^r
Ordered with repetitionlike choosing an r-digit PIN from n possible digits.

Why does order matter sometimes?

Whether order matters is the first question to ask before counting. Contrast a bike-lock combination with a lottery draw:

  • A 4-digit bike lock reading "1-2-3-4" is a different combination from "4-3-2-1" — order matters, so you count with permutations.
  • A lottery draw of {3, 7, 12, 22, 45, 46} is the same winning ticket whichever order the balls come out — order doesn't matter, so you count with combinations.

Repetition is the second question: can an item appear more than once? PIN codes yes, lottery draws no. Together the two toggles pick exactly one of the four formulas below.

The four count modes, piece by piece

Each card explains one of the four counting modes this tool switches between — what the mode assumes about order and repetition, the exact formula it uses, and a worked example that matches the mode's classic archetype.

Permutations without repetition — nPr

Order matters and each item can be used at most once. The tool multiplies a shrinking chain of choices: n · (n−1) · … · (n−r+1).

nPr = n! / (n − r)!
nitems to choose from·rpositions / slots to fill·nPrordered arrangements, no repeats
8×7×6choices shrink: 8 → 7 → 6 · order matters
Example
Given
n = 8 runners, r = 3 medals
Substitute
8 · 7 · 6
Answer
336 arrangements

Ordered with repetition — n^r

Each of the r positions is an independent choice from all n items, so the counts multiply as the same n each time.

count = nʳ
noptions per slot·rnumber of slots
10×10×10×10every slot independent: 10 × 10 × 10 × 10
Example
Given
n = 10 digits, r = 4 slots
Substitute
10 · 10 · 10 · 10
Answer
10,000 PINs

Combinations without repetition — nCr

Order doesn't matter and each item can appear at most once. The tool counts arrangements first, then divides out the r! ways a chosen set can be reordered.

nCr = n! / (r!·(n − r)!)
nitems to choose from·ritems in each unordered group·nCrunordered selections, no repeats
nPr / r!count arrangements, then divide out order6 distinct items chosen · order thrown away
Example
Given
n = 49, r = 6
Substitute
49! / (6! · 43!)
Answer
13,983,816 tickets

Combinations with repetition — (n+r−1)Cr

Unordered but items can repeat — the "multiset" count. The classic stars-and-bars picture converts the problem into choosing r stars among (n+r−1) positions.

count = (n + r − 1)Cr
ndistinct item types·ritems drawn (repeats allowed)
stars & bars★★|||★★★|place r stars into n bins → (n+r−1)Cr
Example
Given
n = 5 flavours, r = 3 scoops
Substitute
7C3 = 7! / (3!·4!)
Answer
35 cones

Features of this calculator

  • One calculator for all four counting cases — permutations and combinations, with or without repetition
  • Automatically selects nPr, n^r, nCr or (n + r − 1)Cr based on the two toggles
  • Live 2×2 decision matrix highlights the formula your toggles pick
  • Practical framing (PIN codes, lottery draws, ice-cream scoops) so the result is easy to interpret
  • BigInt arithmetic — exact counts even when n! would overflow a regular number
  • Step-by-step working shows the formula, the substitution and the cancellation

Frequently asked questions

+What's the exact difference between permutations and combinations?

A permutation is an ordered arrangement — ABC and CAB count as different. A combination is an unordered selection — {A, B, C} is a single set regardless of how you list its members. Permutations are always ≥ combinations for the same n and r, since each combination corresponds to r! different orderings.

+How many 4-digit PINs are possible?

10,000. Each digit is independently 0–9 and repetition is allowed, so the count is 10^4. If repeats were forbidden the count would be 10P4 = 10 × 9 × 8 × 7 = 5,040 instead.

+Why isn't r > n allowed without repetition?

Because you can't pick more distinct items than exist — 5C10 would ask "how many ways to pick 10 distinct items from a pool of 5?", which is zero. The calculator flags this instead of silently returning 0. With repetition allowed, r can exceed n freely.

+Can I compute nCr when n is very large?

Yes — the calculator uses BigInt with the multiplicative form (n · (n−1) · … · (n−r+1)) / r! instead of computing n! directly. This is exact even for n in the hundreds, where n! would have thousands of digits.

Related calculators