ToolNimba

๐Ÿ”ข Permutation Calculator and Combination Calculator (nPr and nCr)

Shihab Mia By Shihab Mia ยท Updated 2026-07-03

Enter n and r with 0 ≤ r ≤ n. Permutations count ordered selections; combinations count unordered ones.

This permutation calculator works out how many ways you can arrange or select r items from a set of n, giving you permutations (nPr), combinations (nCr) and the factorial n! in one place. Permutations count ordered selections where the sequence matters, while combinations count unordered selections where only the group matters. Enter your two numbers and you get exact answers, the formulas used, and a plain warning when results grow too large for an ordinary calculator to handle precisely.

What is the Permutation and Combination Calculator?

Permutations and combinations are the two core counting tools of combinatorics, and the difference between them comes down to a single question: does order matter? If it does, you want a permutation. Ranking three runners as gold, silver and bronze is a permutation because swapping first and second place gives a genuinely different outcome. If order does not matter, you want a combination. Dealing a five-card poker hand is a combination because the same five cards are the same hand no matter what sequence they arrive in. This permutations and combinations calculator computes both at once so you never have to guess which one your problem needs, working equally well as an nPr calculator and an nCr calculator.

The nPr and nCr formula pair starts with the permutation formula nPr = n! / (n - r)!. In words, you multiply n by every integer just below it, stopping after r factors: n, then (n - 1), then (n - 2), and so on down to (n - r + 1). That falling product is exactly what a good permutation calculator computes internally, because building the full factorial and then dividing wastes effort and risks overflow. For example, arranging 3 books chosen from 10 on a shelf gives 10P3 = 10 x 9 x 8 = 720 ordered arrangements.

The combination formula is nCr = n! / (r! (n - r)!). It takes the permutation count and divides by r!, because every unordered group of r items can be shuffled into r! different orders that a combination should count only once. So while there are 720 ways to arrange 3 books from 10 in order, there are only 10C3 = 720 / 6 = 120 distinct sets of 3 books. That single division by r! is the whole conceptual bridge between the two ideas, and seeing both numbers side by side makes the relationship obvious.

A reliable permutation calculator also has to respect the definition boundaries. Both n and r must be non-negative whole numbers, and r can never exceed n, because you cannot select more items than exist. The edge cases are worth knowing: nP0 = nC0 = 1 (there is exactly one way to choose nothing), nPn = n! (arranging everything is a full ordering), and nCn = 1 (there is only one way to take the whole set). This tool enforces every one of these rules and explains any input it rejects.

Because factorials explode so quickly, precision is a real concern. 20! already has 19 digits, and 21! passes the point where a normal floating-point number can be stored exactly. That is why results from a naive permutation calculator can silently round or flip to scientific notation. This tool computes with BigInt, an exact arbitrary-precision integer type, so every digit of nPr, nCr and n! is correct no matter how large your inputs are, and it flags clearly when the answer has grown past the range an ordinary calculator can trust.

Understanding permutations and combinations pays off far beyond homework. They underpin probability (the denominator of a probability is often a combination count), lottery and card odds, password and key-space estimates in security, experiment design in statistics, and scheduling problems where you count how many orderings or groupings are possible. A permutation calculator that doubles as a number of combinations calculator and shows factorials, along with the exact formulas, turns those problems from guesswork into a two-number lookup, and it answers the everyday question of how to calculate permutations without memorising the algebra.

When to use it

  • Working out lottery odds, for example how many 6-number combinations exist from 49 balls (49C6).
  • Counting card and poker outcomes, such as the number of distinct 5-card hands from a 52-card deck (52C5).
  • Estimating password or key strength by counting how many ordered arrangements of characters are possible.
  • Solving probability homework where the denominator is a permutation or combination count.
  • Planning schedules, seating or tournaments by counting how many orderings (permutations) are possible.
  • Checking discrete math and statistics answers quickly against an exact, no-rounding reference.

How to use the Permutation and Combination Calculator

  1. Enter n, the total number of distinct items in your set, into the first field.
  2. Enter r, the number of items you are arranging or selecting, into the second field (r must be 0 to n).
  3. Read nPr for permutations (order matters) and nCr for combinations (order does not matter).
  4. Check n! in the third box, plus the formulas the tool substituted your numbers into.
  5. Use the quick-pick buttons for common setups like 52, 5 or 49, 6, or press Clear to start over.
  6. Copy any result with its Copy button; heed the warning if your numbers exceed safe integer precision.

Formula & method

Permutations: nPr = n! / (n - r)!, computed as the falling product n x (n - 1) x ... x (n - r + 1). Combinations: nCr = n! / (r! (n - r)!), which equals nPr divided by r!. Both require non-negative integers n and r with r ≤ n. By definition nP0 = nC0 = 1 and nCn = 1.
Choosing 3 from 4 items {A, B, C, D}Permutations (order matters)4P3 = 4! / 1! = 24ABC ABD ACB ACDADB ADC BAC BADBCA BCD BDA BDCCAB CAD CBA CBDCDA CDB DAB DACDBA DBC DCA DCBCombinations (order ignored)4C3 = 24 / 3! = 4ABC ABDACD BCDeach group counted once

Worked examples

How many ways can a president, secretary and treasurer be chosen from a club of 10 members? Roles are distinct, so order matters (a permutation).

  1. Identify n = 10 members and r = 3 roles to fill.
  2. Use the permutation formula nPr = n! / (n - r)!, so 10P3 = 10! / 7!.
  3. Cancel to the falling product: 10 x 9 x 8.
  4. Multiply: 10 x 9 = 90, then 90 x 8 = 720.

Result: 10P3 = 720 different ways to assign the three roles.

How many different 3-member committees can be formed from the same 10 members? A committee has no roles, so order does not matter (a combination).

  1. Again n = 10 and r = 3, but now use nCr = n! / (r! (n - r)!).
  2. This equals the permutation count divided by r!: 10C3 = 10P3 / 3!.
  3. You already found 10P3 = 720, and 3! = 6.
  4. Divide: 720 / 6 = 120.

Result: 10C3 = 120 distinct committees, one sixth of the ordered count.

What are the odds base for a 6-number lottery drawn from 49 balls, where order does not matter?

  1. Set n = 49 and r = 6, and use combinations because the draw order is irrelevant.
  2. Compute 49C6 = 49! / (6! x 43!).
  3. This reduces to (49 x 48 x 47 x 46 x 45 x 44) / (6 x 5 x 4 x 3 x 2 x 1).
  4. The numerator is 10,068,347,520 and 6! = 720; divide to finish.

Result: 49C6 = 13,983,816 possible tickets, so a single ticket has about a 1 in 14 million chance.

Permutations (nPr) and combinations (nCr) for n = 5

rnPr (order matters)nCr (order does not matter)
011
155
22010
36010
41205
51201

Common real-world permutation and combination counts

ProblemExpressionResult
Order 3 of 10 books on a shelf10P3720
Pick a 3-book set from 1010C3120
5-card poker hands from a deck52C52,598,960
6-ball lottery from 4949C613,983,816
Ways to seat 6 people in a row6P6 = 6!720

Common mistakes to avoid

  • Using permutations when order does not matter. If rearranging the chosen items does not create a new outcome (committees, hands of cards, groups of friends), you need a combination, not a permutation. Using nPr there overcounts by a factor of r!.
  • Using combinations when order does matter. Rankings, passwords, seating orders and race finishes all depend on sequence. Those are permutations. Using nCr undercounts because it merges arrangements that should be counted separately.
  • Letting r be larger than n. You cannot select or arrange more items than you have, so r must be less than or equal to n. If r > n the count is simply 0, and this calculator will ask you to fix the input rather than return a meaningless number.
  • Forgetting that nP0, nC0 and nCn equal 1. There is exactly one way to choose nothing and exactly one way to take the whole set. These edge cases are easy to miscount as 0; by definition they are 1.
  • Trusting a phone calculator for large results. Factorials and permutations pass the safe integer limit quickly (21! already exceeds it), so ordinary calculators round or switch to scientific notation. Exact BigInt arithmetic, as used here, keeps every digit correct.
  • Computing full factorials unnecessarily. nPr does not require building the whole of n!. The efficient method is the falling product n x (n - 1) x ... x (n - r + 1), which is faster and avoids huge intermediate numbers.

Glossary

Permutation
An ordered arrangement of items. The number of ways to arrange r items chosen from n is nPr = n! / (n - r)!.
Combination
An unordered selection of items. The number of ways to choose r items from n is nCr = n! / (r! (n - r)!).
nPr
Notation for the number of permutations of r objects taken from n distinct objects, read "n permute r".
nCr
Notation for the number of combinations of r objects taken from n distinct objects, read "n choose r".
Factorial (n!)
The product of every whole number from 1 up to n. It counts the arrangements of n distinct items, with 0! defined as 1.
Binomial coefficient
Another name for nCr, written C(n, r) or as n over r in brackets; it gives the coefficients in a binomial expansion.
Order matters
A property of a counting problem where different sequences of the same items count as different outcomes; the signal to use permutations.
BigInt
An exact arbitrary-precision integer type used here so even very large nPr, nCr and n! values are shown without rounding.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts ordered arrangements, so ABC and CBA are different. A combination counts unordered selections, so ABC and CBA are the same group. Use a permutation when sequence matters (rankings, passwords) and a combination when only the chosen set matters (committees, card hands). nCr always equals nPr divided by r!.

How does this permutation calculator compute nPr?

It uses nPr = n! / (n - r)!, but rather than building huge factorials it multiplies the falling product n x (n - 1) x ... down to (n - r + 1). For 10P3 that is 10 x 9 x 8 = 720. This method is faster and avoids overflow, and BigInt keeps the answer exact.

What is the formula for combinations (nCr)?

The combination formula is nCr = n! / (r! (n - r)!). Equivalently it is nPr / r!, because each unordered group of r items can be arranged in r! ways that a combination should count only once. For example 10C3 = 720 / 6 = 120.

Can r be greater than n?

No. You cannot arrange or select more items than exist, so r must be less than or equal to n. If r were greater than n the count would be 0. This calculator asks you to correct the input so the result stays meaningful.

What are nP0, nC0 and nCn equal to?

nP0 and nC0 both equal 1 because there is exactly one way to choose or arrange nothing (the empty selection). nCn also equals 1 because there is only one way to take the entire set. nPn equals n!, the number of ways to arrange all items in order.

Why do large permutations and combinations need BigInt?

Factorials grow explosively; 21! already exceeds the safe integer limit of about 9 quadrillion, so ordinary calculators round the answer or show it in scientific notation. This tool uses BigInt, an exact integer type, so every digit of large nPr, nCr and n! results is correct.

How many 5-card hands are possible from a standard deck?

Order does not matter in a poker hand, so this is a combination: 52C5 = 52! / (5! x 47!) = 2,598,960 distinct hands. Enter n = 52 and r = 5 in the calculator to confirm it instantly.

Is a factorial the same as a permutation?

A factorial is a special case of a permutation. n! equals nPn, the number of ways to arrange all n items in order. When you only arrange r of the n items, you use the more general nPr = n! / (n - r)! instead of a plain factorial.

Do permutations and combinations have to use whole numbers?

Yes. Both n and r must be non-negative integers because you are counting discrete items and cannot have a fractional arrangement or selection. This permutation calculator validates the inputs and rejects negatives, decimals and cases where r exceeds n.

How is this related to probability?

Many probabilities are counted with combinations. The chance of an event is often the number of favorable combinations divided by the total number of combinations. For example a single 49-ball lottery ticket wins with probability 1 / 49C6 = 1 / 13,983,816, roughly 1 in 14 million.