Permutation & Combination Calculator
Calculate nPr and nCr for any n and r — runs entirely in your browser, no upload.
Permutations and combinations
A combination C(n, r) — also written nCr or "n choose r" — counts the number of ways to select r items from a set of n items when order does not matter. A permutation P(n, r) — also written nPr — counts the ordered arrangements: every different ordering of the same items is counted separately. The relationship between them is P(n, r) = C(n, r) × r!. Both are computed exactly using BigInt arithmetic, so there are no floating-point rounding errors even for large inputs like C(52, 5) = 2,598,960 (the number of 5-card poker hands).
Results update as you type. r must be between 0 and n inclusive; both n and r must be non-negative integers.
FAQ
What is the difference between a permutation and a combination? Order matters for permutations, not for combinations. Choosing {A, B} and {B, A} from a set is one combination but two permutations.
What is nCr(n, 0)? It equals 1. There is exactly one way to choose zero items from any set: choose nothing.
Why does the calculator use BigInt? Factorials grow extremely fast. JavaScript's regular numbers lose precision around 2⁵³, so large inputs like nPr(20, 20) = 20! = 2,432,902,008,176,640,000 would silently lose digits. BigInt avoids this entirely.
What is a real-world example of nCr? Choosing 5 cards from a 52-card deck: C(52, 5) = 2,598,960 possible hands. Order doesn't matter — the same five cards dealt in a different sequence is the same hand.