Permutation and Combination Calculator

Enter n, the number of items to choose from, and r, how many you pick. You get the permutations nPr and combinations nCr, both with and without repetition, plus the factorials behind them.

Whole number from 0 to 1,000.

Whole number from 0 to n.

Results update as you type.

Result

Combinations 10C3 (order does not matter)
120
Permutations 10P3 (order matters)
720
Combinations 10C3
120
Permutations with repetition (10^3)
1,000
Combinations with repetition (12C3)
220
10! (n factorial)
3,628,800
3! (r factorial)
6
7! ((n − r) factorial)
5,040

How the results are calculated

  • 10P3 = n! ÷ (n − r)! = 10 × 9 × 8 = 720
  • 10C3 = nPr ÷ r! = 720 ÷ 6 = 120
  • With repetition, ordered: n^r = 10^3 = 1,000
  • With repetition, unordered: (n + r − 1)Cr = 12C3 = 220

Permutations vs. combinations

Both count the ways of picking r items out of n, and the only difference is whether order matters. A permutation is an ordered arrangement: gold, silver and bronze from 10 runners, a 4-digit PIN, the batting order of a team. A combination is an unordered selection: a hand of cards, a lottery ticket, a committee. Because every group of r items can be arranged in r! different orders, there are always far fewer combinations than permutations, and the two are linked by nCr = nPr ÷ r!. The quickest test is to ask whether swapping two of the chosen items gives a different outcome. If it does, you need permutations.

Formulas and a worked example

CaseFormulan = 10, r = 3
Permutations (ordered, no repetition)nPr = n! ÷ (n − r)!720
Combinations (unordered, no repetition)nCr = n! ÷ (r! (n − r)!)120
Permutations with repetitionnr1,000
Combinations with repetition(n + r − 1)Cr220

Example: choose 3 of 10 items. The permutations are 10! ÷ 7!, and since 10! = 10 × 9 × 8 × 7! everything from 7 down cancels, leaving 10 × 9 × 8 = 720. For combinations divide by 3! = 6, because each group of three can be ordered six ways: 720 ÷ 6 = 120. The full factorials are 10! = 3,628,800, 3! = 6 and 7! = 5,040, and 3,628,800 ÷ (6 × 5,040) = 120 confirms the answer. The symbol nCr is also written C(n, r), (n over r) or "n choose r", and these are the binomial coefficients that appear in Pascal's triangle.

Allowing repetition

When an item can be chosen more than once the formulas change. Ordered selections with repetition are simply nr: a 3-digit code using digits 0 to 9 has 10³ = 1,000 possibilities, because each position has all ten choices. Unordered selections with repetition, such as choosing 3 scoops from 10 ice-cream flavours where you may repeat a flavour, are counted by (n + r − 1)Cr = 12C3 = 220. That formula comes from the "stars and bars" argument: 3 scoops and 9 dividers between the 10 flavours form 12 symbols, and choosing where the 3 scoops go among them determines the order.

The lottery example

In a 6-from-49 lottery the order of the drawn balls is irrelevant, so the number of possible tickets is 49C6 = 49 × 48 × 47 × 46 × 45 × 44 ÷ 720 = 13,983,816. One ticket therefore has a 1 in 13,983,816 chance of matching all six numbers, about 0.0000072%. Matching exactly 5 of the 6 is 6C5 × 43C1 = 258 tickets, or roughly 1 in 54,201. The random number generator can pick lottery numbers for you, and the dice roller covers the other classic probability setting.

How fast factorials grow

Factorials outpace every power. 5! is 120, 10! is 3,628,800, 15! already exceeds a trillion (1,307,674,368,000) and 20! is 2,432,902,008,176,640,000, beyond what ordinary floating-point arithmetic stores exactly. 70! is the first factorial above 10¹⁰⁰, a googol. This is why shuffling a 52-card deck has 52! ≈ 8.07 × 10⁶⁷ orderings, more than the number of atoms on Earth, and why the calculator uses exact big-integer arithmetic rather than decimals.

How to use this calculator

  1. Enter n, the size of the pool you are choosing from (0 to 1,000).
  2. Enter r, how many items you pick. Without repetition r cannot exceed n.
  3. Read nCr as the headline if order does not matter, or nPr in the first row if it does.
  4. Use the with-repetition rows when items may be chosen more than once, and the factorial rows to check your own working.

Common mistakes

  • Choosing the wrong formula: ask whether a rearrangement of the same items counts as a new outcome. Seats, rankings and passwords are ordered; teams, hands and lottery draws are not.
  • Forgetting the division by r!: nCr is nPr divided by r!, so a committee of 3 from 10 is 120, not 720.
  • Ignoring repetition: a PIN can repeat digits, so it is 10⁴ = 10,000 codes, not 10P4 = 5,040.
  • Rounding big factorials: a pocket calculator shows 20! as 2.4329 × 10¹⁸ and silently drops digits. Use exact arithmetic, as this page does, when you need the last digits.
  • Probabilities above 1: after counting favourable and total outcomes, divide them; the percentage calculator converts the result to a percentage.

Frequently asked questions

What is the difference between nPr and nCr?

nPr counts ordered arrangements and nCr counts unordered selections. Picking 3 people from 10 for president, secretary and treasurer is a permutation (720 ways) because swapping two people changes the outcome. Picking 3 people for a committee with equal roles is a combination (120 ways). nCr is always nPr divided by r!, because each group of r items can be ordered in r! ways.

Why is 0! equal to 1?

There is exactly one way to arrange nothing: the empty arrangement. Defining 0! = 1 also keeps the formulas consistent, since nCn = n! ÷ (n! × 0!) must equal 1 (there is one way to choose everything) and nC0 must equal 1 as well. It also follows from the pattern n! = n × (n − 1)!, which gives 1! = 1 × 0!.

How do I work out lottery odds?

Lottery draws are combinations because the order the balls appear in does not matter. For a 6-from-49 game, enter n = 49 and r = 6: there are 13,983,816 possible tickets, so a single ticket has a 1 in 13,983,816 chance of the jackpot. For games with a bonus ball, multiply by the number of ways to choose it from the remaining balls.

What if order matters for some choices but not others?

Break the problem into stages and multiply. To pick a captain and then 2 ordinary members from 10 players, choose the captain in 10 ways and the other two as a combination, 9C2 = 36, giving 360 teams. The multiplication principle applies whenever the stages are independent choices.

How large can the numbers get?

The calculator uses exact big-integer arithmetic, so results are precise up to n = 1,000. 1,000! has 2,568 digits and 1,000 to the power 1,000 has 3,001. Results with more than 30 digits are displayed in scientific notation, such as 2.6525 × 10³² for 30!, while the underlying value is still exact.

Related calculators