Permutations & Combinations Calculator
nPr and nCr for any n and r, computed without overflowing on large factorials.
🔒 Runs entirely in your browser — nothing here is ever uploaded
About the Permutations & Combinations Calculator
Computes nPr (permutations — order matters) and nCr (combinations — order doesn't matter) for any whole numbers n and r, using an iterative multiply-and-divide method that stays numerically stable well beyond where a literal factorial calculation would overflow.
- Enter n (the total number of items) and r (how many you're choosing or arranging).
- Read both nPr (permutations) and nCr (combinations) in the result panel.
Choosing and ranking a 1st, 2nd, and 3rd place from 10 runners (order matters): nPr = 10 × 9 × 8 = 720 permutations. Choosing an unordered group of 3 runners to advance from the same 10 (order doesn't matter): nCr = 720 ÷ 3! = 120 combinations.
| Scenario | Order matters? | Use |
|---|---|---|
| Ranking 1st/2nd/3rd place | Yes | nPr |
| Choosing a committee of 3 from 10 people | No | nCr |
| Assigning distinct prizes to winners | Yes | nPr |
| Picking lottery numbers (as a set) | No | nCr |
| Arranging books on a shelf | Yes | nPr |
n and r must both be non-negative whole numbers, with r ≤ n (you can't choose or arrange more items than exist). For very large n, the true result can exceed JavaScript's safe integer range (2^53 − 1, about 9 quadrillion) — past that point, the exact digit-for-digit value can't be represented precisely by a standard number, so the result is shown in scientific notation as an explicit approximation rather than a string of digits that would look exact but isn't.
- • The key question to ask before picking a formula: does swapping the order of two chosen items create a genuinely different outcome? If yes, use nPr; if no, use nCr.
- • nCr is always less than or equal to nPr for the same n and r, since every combination corresponds to r! different permutations (all the ways to order that same group).
- • nCr is symmetric: choosing r items from n is the same count as choosing the (n − r) items you'd leave out — nCr(n, r) = nCr(n, n − r).
- Math is Fun — Combinations and Permutations (formulas and worked examples) — accessed 2026-08-30