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
- Enter n. Type the total number of items in the set.
- Enter r. Type how many you are choosing or arranging from that set.
- Read both results. The permutations (nPr) and combinations (nCr) appear instantly.
- Expand the formula boxes. Open them to see the exact factorial expression used for each answer.
- 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.
| Problem | Formula | Working | Answer |
|---|---|---|---|
| 5P2 | n! ÷ (n−r)! | 5 × 4 | 20 |
| 5C2 | n! ÷ (r!(n−r)!) | (5 × 4) ÷ (2 × 1) | 10 |
| 10P3 | n! ÷ (n−r)! | 10 × 9 × 8 | 720 |
| 10C3 | n! ÷ (r!(n−r)!) | 720 ÷ 6 | 120 |
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
- Factorial Calculator — compute the n! values behind the formulas.
- Percentage Calculator — turn counts into probabilities and shares.
- Scientific Calculator — handle wider calculations around your problem.
- Average Calculator — summarise sets of results quickly.
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.
Recommended reading
Permutation & Combination Calculator: Real-World Use Cases
See where nPr and nCr actually show up — lottery odds, team rosters, passwords, tournament brackets and seating charts — with worked examples you can copy.
nPr vs nCr: Pro Tips and Mistakes to Avoid
Expert tips for permutation and combination problems: decide if order matters, avoid the double-counting trap, and dodge the most common nPr and nCr mistakes.
XOR Cipher Use Cases: CTFs, Learning, and Puzzles
Real use cases for the XOR cipher, from CTF challenges and teaching bitwise logic to lightweight obfuscation, with concrete worked examples.
XOR Cipher Tips: Keys, Security, and Common Mistakes
Pro tips and common mistakes for the repeating-key XOR cipher: key length, reuse pitfalls, format choices, and when to switch to real encryption.