tooldeb Online Tools
Categories
Finance & Investing Interest, savings, returns, and inflation. Loans & Property Mortgages, repayment, DSR/DTI/LTV, and jeonse. Tax & Payroll Take-home pay, severance, insurance, and taxes. Shopping & Pricing Discounts, tips, unit price, and margins. Health & Fitness Body metrics, nutrition, and training. Math Percentages, fractions, algebra, and sequences. Geometry Area, volume, and surface of plane and solid shapes. Statistics & Probability Averages, spread, combinations, and odds. Unit Conversion Length, weight, temperature, pressure, and more. IT & Digital Data size, screens, color, and network speed. Engineering & Electronics Circuits, resistance, PCB, and signals. Date & Time Ages, D-day, date math, and time zones. Home & Interior Paint, tile, wallpaper, flooring, and concrete. Automotive Fuel cost, economy, tires, and vehicle tax. Everyday Bills, delivery, photos, and odds and ends.
EN
한국어 English

Permutation & Combination Calculator

Count the ways to choose r items from n: permutations nPr (order matters) and combinations nCr (order doesn't).

Inputs
Permutations (nPr)
20
Combinations (nCr)
10
Inputs are rounded to whole numbers. When r is negative or larger than n, no arrangement exists and the result is shown as “—”. When n and r are both large, nPr or nCr can exceed Number.MAX_SAFE_INTEGER (2^53−1) and lose precision — the result is shown as “—” rather than a falsely exact-looking number. Counts assume distinct items chosen without repetition.

How permutations and combinations differ

Both count ways to pick r items from n distinct items. A permutation counts ordered arrangements, so ABC and CBA are different. A combination counts unordered selections, so ABC and CBA are the same — which is why nCr divides nPr by r!, the number of orderings of the r chosen items.

nPr = n! / (n − r)! nCr = n! / ( r! · (n − r)! )
  • n — total number of distinct items
  • r — how many are chosen
  • n! — factorial: n × (n−1) × … × 1

More detail

Order matters vs. order doesn't

Choosing 2 people from 5 for President and Vice-President is a permutation (5P2 = 20) because the two roles are different. Choosing 2 people from 5 for an unranked committee is a combination (5C2 = 10) because swapping who was “picked first” changes nothing. There are always r! more permutations than combinations — here 2! = 2, and 20 ÷ 2 = 10.

Quick sanity check. nCr is symmetric: nCr = nC(n−r). So choosing 2 from 5 (10 ways) equals choosing 3 from 5 — picking who's in is the same as picking who's out. nPr is always ≥ nCr, and they're equal only when r is 0 or 1.

Frequently asked questions

What's the difference between a permutation and a combination?

A permutation counts ordered arrangements (order matters); a combination counts unordered selections (order doesn't). For 5 items choosing 2, there are 5P2 = 20 permutations but only 5C2 = 10 combinations — exactly 2! = 2 times fewer, since each pair can be ordered two ways.

How many ways can I choose 2 from 5?

As a combination (order doesn't matter): 5C2 = 5! / (2!·3!) = 10. As a permutation (order matters): 5P2 = 5! / 3! = 20. Enter n = 5, r = 2 above to see both.

What is 10P3 and 10C3?

10P3 = 10 × 9 × 8 = 720 ordered arrangements. 10C3 = 720 ÷ 3! = 720 ÷ 6 = 120 unordered selections. Enter n = 10, r = 3 to check.

What happens if r is larger than n?

You can't choose more distinct items than exist, so both nPr and nCr are 0 — this calculator shows “—”. The formulas require 0 ≤ r ≤ n; nP0 and nC0 both equal 1 (one way to choose nothing).

What happens if n and r are large, like 30 and 15, or 60 and 30?

nPr and nCr are checked separately, because nCr = nPr ÷ r! is never larger (they are equal only when r is 0 or 1). With n = 30, r = 15, nPr exceeds 2^53−1 and shows “—”, but nCr = 155,117,520 still fits and is shown. Only when nCr itself exceeds 2^53−1 (like 60C30) do both show “—” — 2^53−1 is the largest integer a JavaScript number can represent exactly.

Related calculators

Browse all Statistics calculators