Skip to main content

Permutations & Combinations Calculator

Counting problems always ask two questions first: does the order of the chosen items matter, and can an item be chosen twice? The five answers to those questions — permutations, combinations, both with-replacement variants, and circular permutations for seatings around a table — are all computed here from your n and r, on one page. Every count is an exact whole number: factorials and binomial coefficients are kept as arbitrary-precision integers, so a count like C(52, 5) = 2,598,960 prints digit for digit, never rounded into scientific notation.

Whole number, 0 to 5,000.

Whole number, 0 to 5,000.

All five counts for n = 10, r = 3 — exact integers, every digit printed
CountFormulaValue
Permutations — order matters, no repeatsP(10, 3) = 10! ÷ (10 − 3)!720
Combinations — order does not matter, no repeatsC(10, 3) = 10! ÷ (3! × (10 − 3)!)120
Permutations with replacement — order matters, repeats allowed10^31000
Combinations with replacement — order does not matter, repeats allowedC(10 + 3 − 1, 3) = C(12, 3)220
Circular permutations — seatings around a round table(10 − 1)!362880

How it is worked out

  1. n = 10 items, choosing r = 3. Factorials are exact: 10! = 3628800.
  2. Permutations count ordered arrangements; combinations count unordered selections. “With replacement” means an item can be picked again after being chosen.

Embed this calculator on your website →

The formula

P(n, r) = n! ÷ (n − r)! · C(n, r) = n! ÷ (r!(n − r)!)

  • with replacement — order matters: n^r (each of the r picks can be any of the n items); order does not matter: C(n + r − 1, r), the stars-and-bars count.
  • circular permutations — (n − 1)! seatings around a round table, where rotations of the same arrangement count as one.
  • honest refusals — choosing more items than exist (r > n) is refused on the two without-replacement lines only, because the with-replacement counts still make sense; circular orderings of zero items and choosing with replacement from an empty set are likewise refused per line, with the reason, never silently shown as zero.
  • the printing cap — n and r are capped at 5,000, and a count that would print with more than 10,000 digits is counted but not dumped onto the page; its true digit count is stated instead.

Worked example: n = 10, r = 3 gives P(10, 3) = 720 ordered arrangements, C(10, 3) = 120 selections, 10³ = 1,000 with replacement in order, and C(12, 3) = 220 with replacement unordered — the default in the tool above.

How it works

Permutation or combination? Ask whether swapping two chosen items makes a different outcome. A podium finish (gold, silver, bronze) changes when the order swaps — a permutation. A committee does not change when its members are listed in a different order — a combination. Lock codes are permutations with replacement (digits may repeat, order matters); lottery draws are combinations without replacement.

Why (n − 1)! around a table? In a line of n people, rotations are different arrangements. Around a circle, rotating everyone by one seat gives the same neighbours — n seatings collapse into one, so the count divides by n: n! ÷ n = (n − 1)!.

Examples

  • Poker hands — C(52, 5) = 2,598,960 possible five-card hands from a standard deck.
  • Choosing nobody — with r = 0 every selection count is 1: there is exactly one way to choose nothing.
  • Around a table — 10 people seat themselves in (10 − 1)! = 362,880 distinct circular arrangements.

Frequently asked questions

What is the difference between a permutation and a combination?

Order. Permutations count arrangements where the sequence matters (1st, 2nd, 3rd place; a code). Combinations count selections where only the set matters (a committee; a hand of cards). That is why P(n, r) is always r! times C(n, r) — every selection can be arranged in r! orders.

What does 'with replacement' mean?

That after an item is chosen it goes back into the pool and can be chosen again — like rolling the same die repeatedly, or a PIN digit that may repeat. Without replacement, each item can appear at most once, which is why choosing more items than exist (r > n) is impossible there but perfectly fine with replacement.

Why can I not choose r greater than n?

You can — with replacement, where repeats fill the extra picks. Without replacement it would require using an item twice, contradicting the rule, so those two lines refuse with the reason while the other three still answer. Nothing is silently shown as zero.

Why is 0! equal to 1, and what about 0^0?

0! = 1 by definition — the empty product, one way to arrange nothing — and the counting formulas depend on it (C(n, 0) = 1). For permutations with replacement at n = 0, r = 0, the value is 0^0, which this platform takes as 1 by the usual counting convention, and the working says so openly when it happens.

How exact are very large counts?

Completely. Factorials and binomial coefficients are computed as arbitrary-precision integers and printed digit for digit — no floating point, no rounding, no scientific notation. The only cap is presentational: a count beyond 10,000 digits is reported by its digit count rather than flooding the page.