0

Permutations & Combinations Calculator (nPr, nCr)

Compute nPr (permutations) and nCr (combinations) from the same n and r, with the real factorial-cancellation working shown step by step in exact BigInt arithmetic.

Buy Me a Coffee at ko-fi.com
Processing... 0%
Reading n and r
Expanding the factorial chain
Done

Result

A permutation (nPr) counts the number of ways to arrange r items chosen from a set of n when order matters; a combination (nCr) counts the same choice when order does not matter. This calculator takes n and r and computes both in one run, so you can see directly how many more ways there are to arrange a group than there are to simply pick it.

Most calculators evaluate nPr by computing n! and (n-r)! separately and dividing — which means computing huge factorials only to cancel most of them out again. This tool skips that waste entirely: nPr = n × (n-1) × ... × (n-r+1) is built directly as a chain of exactly r descending terms, which already is the cancelled form. For 8P3 that chain is 8 × 7 × 6 = 336, shown exactly as a person doing it by hand would write it. nCr then divides that same chain by r! = r × (r-1) × ... × 1 — for 8C3 that is 336 ÷ (3 × 2 × 1) = 336 ÷ 6 = 56 — again shown as an explicit division, not a hidden factorial ratio.

Every step uses BigInt, JavaScript's arbitrary-precision integer type, so there is never any floating-point rounding: n can go up into the hundreds and the result is still the exact integer, not an approximation that starts losing digits the way ordinary calculator factorials do once they overflow double-precision floats. Chains longer than a dozen terms are shown truncated (first few terms, an ellipsis, then the last few) purely for readability — the underlying arithmetic always uses every term.

Permutations and combinations show up constantly in probability, statistics, lottery and card-game odds, scheduling and seating arrangements, and combinatorics homework. Everything runs locally in your browser — no sign-up, no server round-trip — and the full step-by-step working can be copied as plain text with one click for homework or documentation.