Permutation and Combination Calculator
Enter the total number of items (n) and how many you are choosing (r) to get both nPr — ordered arrangements — and nCr — unordered selections. Results are exact to the last digit, even when they run to dozens of digits.
Formulas & substitution
Order matters — or it doesn’t
A permutation counts ordered arrangements: gold-silver-bronze among 16 runners is 16 × 15 × 14 = 3,360 because each podium order is different. A combination counts selections where order is irrelevant: choosing 3 of 16 people for a committee gives 560, exactly 3,360 ÷ 3!, since every unordered trio was counted 6 times over in the ordered tally. That division by r! is the whole difference between the two formulas.
How it’s calculated
nPr = n! ÷ (n − r)! = n × (n − 1) × … × (n − r + 1). nCr = n! ÷ (r!(n − r)!) = nPr ÷ r!. Both are computed with exact integer arithmetic (BigInt), so there is no floating-point rounding even for values like C(100, 50) = 100,891,344,545,564,193,334,812,497,256. Inputs are capped at n ≤ 5,000.
Results update as you type and are for education, not professional advice — double-check any number that matters.
Worked example
With n = 16 and r = 3: nPr = 16 × 15 × 14 = 3,360 ordered arrangements, and nCr = 3,360 ÷ 3! = 3,360 ÷ 6 = 560 committees. A poker example: C(52, 5) = 2,598,960 possible five-card hands, while P(52, 5) = 311,875,200 ordered deals.
Common mistakes
- Using nPr for committees or lottery picks — when order is irrelevant, nCr is the answer (and much smaller).
- Letting r exceed n — there are zero ways to choose 7 items from 5.
- Trusting a floating-point factorial for big n — standard calculators silently round past 15 digits; this tool does not.
Where it is used
- Lottery and card-game odds (as the denominator of a probability).
- Counting passwords, PINs, seatings, and schedules.
- Binomial coefficients for probability and Pascal’s triangle.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts arrangements where order matters (races, passwords); nCr counts selections where it does not (committees, lottery tickets). They differ by exactly a factor of r!: nPr = nCr × r!.
What are 0! and nC0?
0! is defined as 1, which makes the formulas work at the edges: nC0 = nCn = 1 (one way to choose nothing or everything) and nP0 = 1.
How large can n be here?
Up to 5,000, computed exactly with arbitrary-precision integers. C(5000, 2500) has over 1,500 digits; the result rows show a scientific approximation and the steps panel notes the digit count.
Are repetitions allowed?
No — these formulas assume each item is picked at most once. With repetition allowed, arrangements become nʳ and selections become C(n + r − 1, r).
How do combinations turn into probabilities?
Divide favorable outcomes by total outcomes. One lottery ticket choosing 6 of 49 wins the jackpot with probability 1 ÷ C(49, 6) = 1 in 13,983,816.