Home ›
Math › Permutation and Combination Calculator
· 🌐 EN / DE Permutation and Combination Calculator
Calculate permutations (nPr) and combinations (nCr) for any n and r instantly.
Example
With n = 5 and r = 2:
nPr = 5! / (5-2)! = 120 / 6 = 20
nCr = 5! / (2! (5-2)!) = 120 / (2 x 6) = 10
So there are 20 ordered arrangements and 10 unordered selections.
How it works
Enter the total number of items n and the number chosen r. The tool computes nPr = n!/(n-r)! and nCr = n!/(r!(n-r)!) iteratively to avoid factorial overflow.
Good to know
This calculator takes two whole numbers — n, the total number of items you have, and r, the number you pick — and instantly returns both the permutation count (nPr) and the combination count (nCr). It is built for students working through probability or discrete-math homework, teachers checking answer keys, and anyone who needs a quick count of how many ways a selection can be made without writing out factorials by hand.
Reach for it whenever the question is "how many ways can I arrange or choose these?" Use nPr when the order of the picks changes the outcome — seating people in a row, assigning gold/silver/bronze medals, or generating a passcode where 1-2-3 differs from 3-2-1. Use nCr when order is irrelevant — dealing a poker hand, picking a committee, or choosing lottery numbers. The tool shows both side by side so you can compare them at a glance.
To read the result, look at the large nPr figure and the nCr stat beside it, then check the two formula lines, which substitute your actual n and r into n!/(n-r)! and n!/(r!(n-r)!) so you can see how the number was built. nPr will always be the larger value (or equal when r is 0 or 1), because every unordered combination corresponds to r! different ordered arrangements.
A practical note: the counts grow extremely fast, so very large inputs are shown in scientific notation (for example 1.234560e+18) once they pass roughly 15 digits, where ordinary integer precision ends. The calculator computes iteratively to avoid factorial overflow and reduces nCr internally, but treat results above that threshold as accurate approximations rather than exact digit-by-digit integers, and remember it expects non-negative whole numbers only.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts ordered arrangements (order matters), while nCr counts unordered selections (order does not matter). Because each combination can be arranged r! ways, nPr = nCr x r!.
Why does the result become 0 when r is greater than n?
You cannot choose more items than are available, so both nPr and nCr are defined as 0 when r > n. The calculator guards this case instead of producing an error.
Is my data uploaded anywhere?
No — this calculator runs entirely in your browser; nothing is uploaded.
Is it free?
Yes, completely free with no sign-up and no limits.
People also ask
What is nPr equal to when r equals n?
When r equals n, nPr equals n! (n factorial), because you are arranging every available item in order. In the same case nCr equals 1, since there is only one way to select the entire set.
What does nCr equal when r is 0?
Both nCr and nPr equal 1 when r is 0. There is exactly one way to choose nothing — the empty selection — which is why 0! is defined as 1.
How do you calculate permutations without a factorial of a huge number?
You multiply only r descending terms: n times (n-1) times (n-2) down to (n-r+1). This iterative product gives nPr directly and avoids computing the full n! and (n-r)! separately, which keeps the numbers manageable.
Is nPr always bigger than nCr?
Yes, nPr is greater than or equal to nCr for the same n and r, because nPr = nCr times r!. They are equal only when r is 0 or 1, since 0! and 1! both equal 1.
Should I use permutations or combinations for a lottery?
Most lotteries use combinations (nCr) because the order in which numbers are drawn does not matter. You would only use permutations if the game required matching numbers in a specific drawn sequence.
What is the formula relationship between nPr and nCr?
nPr = nCr × r!, which rearranges to nCr = nPr / r!. This holds because each unordered combination of r items can be arranged in r! different ordered ways.
Can n or r be a decimal or negative number?
No. Permutations and combinations are defined only for non-negative whole numbers, so this calculator expects integers and treats negative or fractional inputs as invalid.
How many ways can you arrange 5 items taken 2 at a time?
There are 20 ordered arrangements (5P2 = 5 × 4 = 20) and 10 unordered selections (5C2 = 10). The permutation count is exactly r! = 2 times larger than the combination count.
Related calculators