🧮
🧮 Math & statistics

Permutation & Combination Calculator (nPr, nCr)

Results update as you type.

Your numbers

Understanding the permutation and combination calculator — concept and principle

Permutations and combinations count the ways to choose r items from n distinct items. A permutation (nPr) cares about order, like awarding gold, silver and bronze medals; a combination (nCr) ignores order, like choosing a committee or lottery numbers. This calculator gives both, plus the two "with repetition" versions, so you can match the count to the situation.

Permutations and combinations of 3 from 10Ordered picks give 10 × 9 × 8 = 720; each group of three appears in 6 orders, so there are 720 ÷ 6 = 120 combinations.Pick 3 of 10 numbered balls0123456789Order matters (nPr)10 × 9 × 8720these 6 orders are the same group (3! = 6)123132213231312321Order ignored (nCr)720 ÷ 6120Repeats allowed: 10³ = 1,000 codesunordered with repeats: ₁₂C₃ = 220
Every group of 3 shows up in 3! = 6 orders, so 720 permutations shrink to 120 combinations.

How it is calculated

n and r are whole numbers with 0 ≤ r ≤ n for the first two formulas.

The principle

For an ordered choice there are n options for the first pick, n − 1 for the second, and so on for r picks; multiplying them gives nPr. Each unordered group of r items appears in that list r! times, once for each of its possible orders, so dividing by r! leaves the number of combinations. With repetition, every pick has all n options, giving nʳ. Unordered selection with repetition is counted by the "stars and bars" idea: choosing r items from n types is the same as placing r stars and n − 1 dividing bars in a row, which can be done in (n + r − 1)Cr ways.

Worked example

  1. Inputs: n = 10, r = 3.
  2. nPr = 10 × 9 × 8 = 720.
  3. nCr = 720 ÷ 3! = 720 ÷ 6 = 120.
  4. With repetition, ordered: 10³ = 1,000 (all three-digit codes from 000 to 999).
  5. With repetition, unordered: (10 + 3 − 1)C3 = 12C3 = 12 × 11 × 10 ÷ 6 = 220.

How to read the result

Ask two questions: does order matter, and can an item be used more than once? The answers point to one of the four results. Combination counts are symmetric, nCr = nC(n − r), so choosing 3 of 10 to include gives the same count as choosing 7 to leave out. The probability of one particular combination is 1 ÷ nCr; for a 6-from-45 lottery that is 1 in 8,145,060.

Common mistakes

Keep in mind: These formulas assume every arrangement is equally possible and all items are distinguishable. Real probability questions may involve dependent events or unequal chances, so check the setting before turning counts into probabilities.

Frequently asked questions

What is the difference between nPr and nCr in one sentence?

nPr counts ordered selections, nCr counts unordered ones, and nPr = nCr × r!.

What is nC0 or nCn?

Both equal 1: there is exactly one way to choose nothing and one way to choose everything.

How many 5-card poker hands are there?

A hand is unordered, so it is 52C5 = 2,598,960.

Sources: Donald E. Knuth, The Art of Computer Programming, Vol. 1, §1.2.6 (Binomial Coefficients) · R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, 2nd ed., Addison-Wesley, 1994, Chapter 5

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

</> Add this calculator to your website (free)

Copy this code into your blog or site. It is free to use; please keep the credit link.

Preview
🧮 All math & statistics tools →🌍 Calculators by country →