BYTETOOLS

How to Calculate nPr and nCr: A Free Guide

To calculate a permutation, use nPr = n! ÷ (n − r)!; for a combination, use nCr = n! ÷ (r! × (n − r)!) — the difference is whether order matters. The ByteTools Permutation & Combination Calculator works out both from just two numbers, n and r, and shows the factorial formula behind each answer so you can follow the method rather than memorise it. Here is how to use it and how the math works.

What n and r mean

Every counting problem reduces to two values: n is the total number of items you have, and r is how many you are choosing or arranging. The calculator takes those two whole numbers and returns nPr (arrangements) and nCr (selections) side by side, so you can compare them directly instead of running two separate calculations.

Step by step

  1. Enter n. Type the total number of items in the set.
  2. Enter r. Type how many you are choosing or arranging from that set.
  3. Read both results. The permutations (nPr) and combinations (nCr) appear instantly.
  4. Expand the formula boxes. Open them to see the exact factorial expression used for each answer.
  5. Copy what you need. One click copies either exact result to your clipboard.

The formulas, with worked examples

Permutations count ordered arrangements — ABC and CAB are different. Combinations count unordered selections — ABC and CAB are the same group. That is why nPr is always greater than or equal to nCr for the same inputs.

ProblemFormulaWorkingAnswer
5P2n! ÷ (n−r)!5 × 420
5C2n! ÷ (r!(n−r)!)(5 × 4) ÷ (2 × 1)10
10P3n! ÷ (n−r)!10 × 9 × 8720
10C3n! ÷ (r!(n−r)!)720 ÷ 6120

In practice the calculator multiplies n by (n−1) down to (n−r+1) rather than computing giant factorials in full, which is faster and avoids unnecessary overflow. When r is larger than n — impossible, since you cannot choose more items than you have — it shows a friendly error instead of a wrong number.

Exact, private and offline

The tool uses JavaScript BigInt arithmetic, so even results with hundreds of digits stay exact rather than rounding into scientific notation. Everything runs locally in your browser — nothing you type is uploaded, logged or stored — which makes it safe for homework, exams and research alike, and it keeps working offline once loaded.

Try the Permutation & Combination Calculator — free and 100% in your browser.

FAQ

How do I calculate 5P2 by hand?

Use nPr = n! ÷ (n − r)!, which simplifies to multiplying n down for r terms. For 5P2 that is 5 × 4 = 20. The calculator shows this same expression when you expand the formula box.

When should I use nPr instead of nCr?

Use nPr when order matters, such as arranging finishers in a race or letters in a code. Use nCr when order does not matter, such as choosing a committee or a hand of cards.

What happens if I enter r greater than n?

The calculator shows a friendly error, because you cannot arrange or choose more items than exist. Reduce r so it is less than or equal to n and a valid result appears.

Will very large values still be accurate?

Yes. The tool uses BigInt maths, so large results stay exact to every digit. It only caps inputs to keep your browser responsive and warns you if a value is too big.

Related free tools

Built by ByteVancer

ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS and custom software. If you need custom calculators or data tools built to a high standard, explore what ByteVancer can create for you.