All tools
Math & Everyday

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.

100% Free Runs in Your Browser No Sign-Up Required
How to use it
  1. Enter n (the total number of items) and r (how many you're choosing or arranging).
  2. Read both nPr (permutations) and nCr (combinations) in the result panel.
Formula
Permutations: nPr = n! ÷ (n − r)! Combinations: nCr = n! ÷ (r! × (n − r)!) Computed here as an iterative product (multiplying and dividing term-by-term) rather than by forming n! directly — this avoids both the precision drift that starts creeping into a literal factorial around 19! and the overflow to Infinity that hits standard double-precision numbers past 171!.
Worked example

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.

Permutations vs. combinations — when to use each
Permutations vs. combinations — when to use each
ScenarioOrder matters?Use
Ranking 1st/2nd/3rd placeYesnPr
Choosing a committee of 3 from 10 peopleNonCr
Assigning distinct prizes to winnersYesnPr
Picking lottery numbers (as a set)NonCr
Arranging books on a shelfYesnPr
Interpreting your result

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.

Recommendations
  • 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).
Frequently asked questions
A permutation counts arrangements where order matters (ABC is different from CBA); a combination counts selections where order doesn't matter (ABC and CBA count as the same group).