Permutation and Combination Calculator
Enter n and r to instantly find nPr and nCr, computed exactly with big-integer math right in your browser.
๐ How it works & FAQWhat are permutations and combinations?
Both count the ways to pick r items from a set of n items โ the difference is whether order matters. A permutation counts ordered arrangements, so "A then B" is different from "B then A". A combination counts unordered selections, where "A and B" is the same group no matter the order. Because every combination can be arranged in r! ways, combinations are always fewer than or equal to permutations for the same n and r.
The formulas this calculator uses
Permutations: nPr = n! / (n โ r)!. Combinations: nCr = n! / (r!(n โ r)!). The exclamation mark means factorial โ the product of every whole number down to 1, so 5! = 5 ร 4 ร 3 ร 2 ร 1 = 120. These values grow fast, so this tool computes them with JavaScript BigInt, giving exact whole-number answers with no rounding or scientific-notation error even for large n.
How to use it
- Type the total number of items into the n box.
- Type how many you are choosing into the r box.
- Read the exact nPr (ordered) and nCr (unordered) results below.
- Adjust either number โ results update instantly as you type.
- If a message appears, fix the inputs so that 0 โค r โค n and both are whole numbers.
FAQ
- When should I use nPr versus nCr?
- Use nPr when order matters (race finishes, passwords, seat arrangements). Use nCr when it does not (lottery draws, committees, pizza toppings).
- What if r equals 0 or r equals n?
- Both are valid. nCr = 1 in each case (one empty group, or one full group), and nPr equals 1 when r = 0 and n! when r = n.
- Why do you use BigInt?
- Factorials overflow ordinary floating-point numbers quickly and lose precision. BigInt keeps every digit exact, so answers like 52! are correct to the last digit.
- Does my data leave my device?
- No. Every calculation runs in your browser โ nothing is uploaded or stored.