KKwikfig.

Permutation & Combination Calculator

Calculate permutations and combinations from n and r with the factorial substitution shown step by step, plus a plain test for which one your problem needs. Runs entirely in your browser — your numbers never leave this device.

Permutations — 10P3 (order matters)
720
10! / (10 − 3)! = 10 × 9 × 8 = 720
Combinations — 10C3 (order doesn't matter)
120
10! / (3! × (10 − 3)!) = (10 × 9 × 8) / (3 × 2 × 1) = 120

Permutations count arrangements, so swapping two chosen items makes a new one; combinations count sets, so the same items in any order count once. That is why nPr is always nCr × r!.

How it works

Permutations (order matters): nPr = n! / (n − r)! | Combinations (order does not matter): nCr = n! / (r! × (n − r)!), also written C(n, r) or 'n choose r'

Both formulas count selections of r items from a group of n — the only difference is whether the order of selection creates a new outcome. A permutation counts arrangements: choosing a president, vice-president and treasurer from 10 people is a permutation, because swapping two people's roles gives a different result. Its formula, nPr = n! / (n − r)!, works because the (n − r)! cancels the tail of n!, leaving just the falling product of the r choices actually made — for 10P3 that is simply 10 × 9 × 8. The calculator shows that cancellation rather than two giant factorials.

A combination counts groups: choosing a 3-person committee from the same 10 people is a combination, because the same three people are the same committee however they were picked. Every group of r people can be arranged in r! orders, and the permutation formula counts each of those orders separately — so dividing by r! removes the double-counting and leaves nCr = n! / (r! × (n − r)!). That single division is the whole relationship between the two formulas: 10P3 = 720 counts orderings, and 720 / 3! = 720 / 6 = 120 = 10C3 counts the groups themselves.

Not sure which one your problem needs? Apply the swap test: take one valid outcome and swap two of the selected items. If the swap produces a different outcome — a different podium, a different running order, a different code — the problem is a permutation. If nothing has really changed — the same committee, the same hand of cards, the same lottery numbers — it is a combination. Edge cases behave sensibly and the calculator reports them plainly: choosing nothing (r = 0) or everything (r = n) gives exactly 1 combination, and asking to choose more items than exist (r > n) has no answer rather than a factorial of a negative number.

Worked examples

Permutation: 10P3 — filling three ranked places from 10

Input
n = 10, r = 3, Type = permutation
Working
10P3 = 10! / (10 − 3)! = 10! / 7!. The 7! cancels the tail of 10!, leaving 10 × 9 × 8 = 720. Read it directly: 10 choices for first place, then 9 for second, then 8 for third.
Result
10P3 = 720

Combination: 10C3 — a three-person committee from 10

Input
n = 10, r = 3, Type = combination
Working
10C3 = 10! / (3! × 7!) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120. The division by 6 removes the 6 orders in which each committee of three could have been picked.
Result
10C3 = 120

Combination: 52C5 — possible five-card poker hands

Input
n = 52, r = 5, Type = combination
Working
52C5 = 52! / (5! × 47!) = (52 × 51 × 50 × 49 × 48) / (5 × 4 × 3 × 2 × 1) = 311,875,200 / 120 = 2,598,960. A hand is a combination because the order the five cards were dealt does not change the hand.
Result
52C5 = 2,598,960 poker hands

Frequently asked questions

What is the difference between a permutation and a combination?

Order. A permutation counts arrangements where swapping two selected items creates a new outcome — finishing positions, ranked roles, codes. A combination counts groups where the same set is the same outcome however it was assembled — committees, hands of cards, lottery numbers. The swap test settles it: if swapping changes the outcome, use nPr; if not, use nCr.

Why does the combination formula divide by r!?

Because the permutation count treats every ordering of the same group as separate. A group of r items can be ordered in r! ways — 3 items in 6 ways, 5 cards in 120 ways — so dividing the permutation count by r! collapses each set of r! orderings back into the single group it really is. That is why combinations are always smaller than the matching permutations (except when r is 0 or 1).

What does 'n choose r' mean?

It is the spoken name for nCr, the number of combinations of r items chosen from n. '10 choose 3' is 120, and '52 choose 5' is 2,598,960. The same quantity appears throughout mathematics as the binomial coefficient, written with n over r in tall brackets, because it gives the coefficients in expansions like (a + b)ⁿ.

Why is nC0 and nCn both equal to 1?

There is exactly one way to choose nothing from a group — leave everything behind — and exactly one way to choose everything — take it all. The formula agrees: nC0 = n! / (0! × n!) = 1, using 0! = 1. These are not special cases bolted on; they fall out of the same formula as every other value.

Can r be larger than n?

No selection can take more distinct items than the group contains, so there is nothing to count — the factorial formula would demand the factorial of a negative number, which does not exist. The calculator flags r > n as an invalid input with that explanation instead of printing zero, which would wrongly suggest a counting answer was found.

Is anything I enter uploaded or saved?

No. This calculator runs 100% in your browser — n and r are processed locally on your device, nothing is uploaded to a server, and no record of your calculation is kept after you close the page.

Related tools

More in Math Calculators · Browse all tools