Skip to content

Permutation and Combination Calculator

Count the ways to arrange or choose r items from n, with or without repetition. Gives exact nPr, nCr, n^r and multiset values for n and r up to 1,000, with the formulas worked out.

  • Free, no sign-up
  • Runs in your browser
  • Math
Repetition
Allowed means an item can be picked more than once, like digits in a PIN.
Whole numbers from 0 to 1,000.

Read the guide Permutations vs Combinations: How to Count Arrangements

How to use the calculator

Enter the total number of items, n, and how many you pick, r. Then say whether repetition is allowed and press Calculate.

  • Not allowed: each item can be used at most once, like people taking places on a podium or cards dealt from a deck. You get the number of permutations (nPr) and combinations (nCr).
  • Allowed: an item can be picked again, like the digits of a PIN or scoops of the same ice cream flavor. You get n^r ordered arrangements and the number of combinations with repetition.

Every result is an exact whole number. When a result has more than 15 digits, the result card shows a scientific approximation and the digit count, and the full number appears in the details panel.

Permutations or combinations?

Ask whether order matters. If picking A then B is different from picking B then A, you are counting permutations. If only the group matters, you are counting combinations. Every combination of r items can be ordered in r! ways, which is why nCr = nPr / r!.

Formulas

  • Permutations: nPr = n! / (n − r)!
  • Combinations: nCr = n! / (r! × (n − r)!)
  • Permutations with repetition: n^r
  • Combinations with repetition: C(n + r − 1, r) = (n + r − 1)! / (r! × (n − 1)!)

Worked example

Ten runners compete for gold, silver and bronze, so n = 10 and r = 3. Order matters, so there are 10P3 = 10 × 9 × 8 = 720 possible podiums. If you only ask which three runners reach the podium, the count is 10C3 = 720 / 3! = 720 / 6 = 120.

Now allow repetition. A three-digit code using the digits 0 to 9 has 10^3 = 1,000 possibilities. Choosing three scoops from ten flavors, where flavors can repeat and order does not matter, gives C(12, 3) = 220 options.

A poker hand is 5 cards from 52 without repetition, and order does not matter: 52C5 = 2,598,960 hands.

Good to know

  • Without repetition you cannot pick more items than you have, so r larger than n gives 0. With repetition, r can be larger than n.
  • By convention 0! = 1, so choosing nothing can be done in exactly one way: nP0 = nC0 = 1.
  • Factorials grow very fast. 1000! has 2,568 digits, which is why the calculator works with exact big integers rather than ordinary decimal numbers.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation is an ordered arrangement, so ABC and CBA count as two different results. A combination is just a selection, so ABC and CBA are the same group. For the same n and r there are always at least as many permutations as combinations.

Why is nCr equal to nCr with r replaced by n − r?

Choosing r items to take is the same as choosing the n − r items you leave behind. For example, picking 8 of 10 books to keep is the same decision as picking the 2 you give away, so 10C8 = 10C2 = 45.

How many lottery combinations are there for 6 numbers out of 49?

Order does not matter and each number can be drawn only once, so it is 49C6. Enter n = 49 and r = 6 with repetition not allowed to get 13,983,816 combinations.

Why are some results shown as an approximation?

Results longer than 15 digits are summarized in scientific notation, such as 4.023872601e+2567 for 1000!, which means about 4.02 times 10 to the power 2,567. The exact value is still calculated and shown in full in the details panel.