Combination & Permutation Calculator
Calculate combinations (nCr) or permutations (nPr) exactly. Enter n and r to find how many ways to choose or arrange items, with the exact result and formula used — no floating-point overflow, even for large values.
Calculator Inputs
The total number of items to choose or arrange from. Must be a whole number from 0 to 1000.
How many items are chosen or arranged. Must be a whole number, no greater than n.
- Exact Result
- 120
- Formula Used
- Combination: C(10, 3) = 10! / (3! × (10 - 3)!)
About these results
CalcSpectrum calculators produce automated estimates using established formulas and the specific values you enter. Because real-world outcomes depend on input accuracy, mathematical assumptions, and rounding conventions, please verify critical figures with an appropriately qualified financial, tax, medical, legal, or other professional, as relevant.
How It's Calculated
Formula
Combinations and permutations both count the number of ways to select r items out of a total of n items — the difference is whether order matters. A combination (nCr, also written C(n, r) or "n choose r") counts selections where order does NOT matter: choosing {A, B, C} is the same result as choosing {C, B, A}. A permutation (nPr, also written P(n, r)) counts arrangements where order DOES matter: placing A, then B, then C is a different outcome from placing C, then B, then A. Because permutations count every ordering of each combination separately, nPr is always greater than or equal to nCr for the same n and r — specifically, nPr = nCr × r!. This calculator computes both formulas exactly, using arbitrary-precision integer arithmetic rather than ordinary floating-point math, so results stay exact even when n and r are large enough that a naive factorial calculation would silently lose precision.
Worked Examples
Combination: choosing 2 people from a group of 5 (5C2)
- Formula: C(5, 2) = 5! / (2! × (5 - 2)!) = 5! / (2! × 3!)
- Expand: (5 × 4 × 3 × 2 × 1) / ((2 × 1) × (3 × 2 × 1)) = 120 / (2 × 6) = 120 / 12
- Result: C(5, 2) = 10 — there are 10 distinct ways to choose 2 people from a group of 5, when the order they're chosen in doesn't matter.
Permutation: awarding 1st and 2nd place among 5 runners (5P2)
- Formula: P(5, 2) = 5! / (5 - 2)! = 5! / 3!
- Expand: (5 × 4 × 3 × 2 × 1) / (3 × 2 × 1) = 120 / 6
- Result: P(5, 2) = 20 — there are 20 distinct ways to award 1st and 2nd place among 5 runners, since who comes in 1st versus 2nd matters.
Frequently Asked Questions
What's the actual difference between a combination and a permutation?
Order. A combination counts groups where the order of selection is irrelevant (a committee of 3 people is the same committee no matter what order you picked them in). A permutation counts arrangements where order matters (1st, 2nd, and 3rd place are different outcomes even with the same 3 people). Every combination corresponds to r! different permutations, since there are r! ways to order any given group of r items.
Why does this calculator use r = 0 or r = n as valid inputs?
Both are meaningful boundaries, not errors. Choosing 0 items from n has exactly 1 way to do it — the empty selection — so both C(n, 0) and P(n, 0) equal 1. Choosing all n items with order ignored also has exactly 1 way (there's only one possible group: everything), so C(n, n) = 1; but arranging all n items in every possible order gives P(n, n) = n!, since order now matters for the full set.
Why is there a maximum value for n?
This calculator caps n at 1000 as a practical usability limit, not a mathematical one — the underlying arithmetic uses arbitrary-precision integers with no inherent size ceiling. At n = 1000, results can already run into hundreds of digits (C(1000, 500) has over 300 digits), which is about the practical limit of what's useful to display and read as a single number.
Why don't large values of n produce a rounded or approximate answer?
Because this calculator never computes a factorial as an ordinary floating-point number. Ordinary numeric types lose exact precision once a value exceeds about 9 quadrillion (2^53), which happens by n = 21 for a raw factorial. Instead, this calculator builds up the result using exact whole-number arithmetic the entire way through, so the final answer is always exact — never rounded — regardless of how large n and r are within the supported range.
Can r be larger than n?
No — you can't choose or arrange more items than exist in the total set, so r must be less than or equal to n. Entering r > n returns an invalid-input result rather than a number.