All Tools

Permutation and Combination Calculator: nPr, nCr

Work out permutations nPr and combinations nCr, with and without repetition, exactly for n up to 1000, with the formula for each. A probability mode combines two independent events. Free and private in your browser.

Calculate

Permutations (nPr)

Order matters, each item used at most once.

720

10P3 = 10! / (10 − 3)! = 10 × 9 × 8

Combinations (nCr)

Order does not matter, each item used at most once.

120

10C3 = 10! / (3! × (10 − 3)!)

Permutations with repetition (nʳ)

Order matters, items may repeat.

1,000

nʳ = 10^3

Combinations with repetition

Order does not matter, items may repeat.

220

C(n + r − 1, r) = C(12, 3)


Permutation and Combination Calculator

Enter n, the number of items to choose from, and r, the number you choose, and this calculator gives four exact counts at once: permutations nPr, combinations nCr, permutations with repetition nʳ and combinations with repetition. Every card shows its formula with your numbers. Counts are exact big integers for n and r up to 1000, and very long ones come with a digit count, an approximation and a Copy button. A second mode works out probabilities for two independent events. The page opens with n = 10 and r = 3.

Which count do I need?

Order and repetition

  • Order matters, no repeats: permutations nPr. Gold, silver and bronze from 10 runners: 720.
  • Order does not matter, no repeats: combinations nCr. A committee of 3 from 10 people: 120.
  • Order matters, repeats allowed: nʳ. A 3-digit code from 10 digits: 1,000.
  • Order does not matter, repeats allowed: C(n + r − 1, r). 3 scoops from 10 flavours: 220.

Formulas

nPr=n!(n−r)!nCr=n!r! (n−r)!nr(n+r−1r){}_nP_r = \frac{n!}{(n-r)!} \qquad {}_nC_r = \frac{n!}{r!\,(n-r)!} \qquad n^r \qquad \binom{n+r-1}{r}

Without repetition, r cannot be larger than n, so nPr and nCr read "Needs r ≤ n without repetition" when it is. With repetition r can be larger: for n = 3 and r = 5 there are 243 ordered and 21 unordered choices.

Worked example: a poker hand

A 5-card hand from a 52-card deck is a combination, because the order you receive the cards does not matter: 52C5 = 2,598,960. If the order did matter, as when dealing 5 named positions, it would be 52P5 = 52 × 51 × 50 × 49 × 48 = 311,875,200, which is 5! = 120 times larger.

Edge cases

Choosing nothing has exactly one way, so every count is 1 when r = 0. nPn = n! and nCn = 1: for n = 5, 5P5 = 120 and 5C5 = 1. With n = 0 and repetition, the only possible choice is the empty one, so the counts are 1 for r = 0 and 0 otherwise.

Probability of two events

Switch to Probability and enter P(A) and P(B) as decimals or percentages. The events are assumed to be independent, so P(A and B) = P(A) × P(B) and P(A or B) = P(A) + P(B) − P(A)P(B). The page also gives P(not A), P(not B), P(neither) and P(exactly one).

Privacy

Nothing is uploaded; every calculation runs in your browser and never leaves your device.

Related tools

The Pascal's Triangle Calculator shows the triangle of nCr values and a C(n,k) table. The Permutation Calculator, Combination Calculator and Probability Calculator open this tool on that count or mode, and the Random Number Generator draws random picks.

Frequently asked questions

What is the difference between a permutation and a combination?

In a permutation the order matters, so ABC and CBA are different. In a combination only the selection matters, so they are the same. That is why nPr is always at least nCr: for n = 10 and r = 3, nPr = 720 and nCr = 120.

What are the formulas?

nPr = n! / (n − r)! and nCr = n! / (r!(n − r)!). With repetition allowed, permutations are nʳ and combinations are C(n + r − 1, r). Each card on the page shows its formula with your numbers.

Why does nPr say it needs r ≤ n?

Without repetition you cannot choose more items than there are, so nPr and nCr are only defined for r up to n. With repetition, r can be larger: for n = 3 and r = 5 there are 243 ordered and 21 unordered choices.

How large can n and r be?

Both can be whole numbers from 0 to 1000. Results are exact, using big integers, so 1000¹⁰⁰⁰ shows all 3,001 digits with a Copy button and the approximation 1e3000.

How does the probability mode work?

Enter P(A) and P(B) as decimals from 0 to 1 or as percentages. Assuming the events are independent, it gives P(A and B) = P(A)P(B), P(A or B), P(not A), P(not B), P(neither) and P(exactly one).

Where is Pascal's triangle?

The Pascal's triangle calculator shows the triangle of nCr values and a C(n,k) calculator, so this page links to it instead of repeating it.

Other related tools