Permutation and Combination Calculator

Count arrangements and selections, with or without repetition.

Permutation and Combination Calculator tool

—
Combinations nCr (order does not matter)
—
Permutations nPr (order matters)
—
Combinations with repetition
—
Permutations with repetition (nʳ)

About the Permutation and Combination Calculator

Counting problems depend on one question: does the order matter? Choosing first, second and third place from ten runners gives 10P3 = 720 permutations, while choosing any three of the ten for a team gives 10C3 = 120 combinations. This permutation and combination calculator handles both, with and without repetition, using exact arithmetic even for huge counts, such as the 13,983,816 ways to pick 6 numbers from 49.

The formulas are nPr = n! ÷ (n − r)! and nCr = n! ÷ (r! (n − r)!). Since every group of r chosen items can be ordered in r! ways, nCr is simply nPr divided by r!. When items can be reused, as with digits in a PIN, the count of ordered arrangements is nʳ, and the count of unordered selections with repetition, sometimes called multisets or stars and bars, is (n + r − 1)! ÷ (r! (n − 1)!).

Example: choosing 3 from 10 gives 10P3 = 10 × 9 × 8 = 720 ordered podiums and 10C3 = 720 ÷ 6 = 120 unordered groups. With repetition there are 10³ = 1,000 three-digit codes using the digits 0 to 9, and 220 ways to buy three scoops from ten ice-cream flavours when you may repeat a flavour. For a lottery that draws 5 numbers from 52, there are 2,598,960 possible tickets.

Results above about 300 digits are shown in scientific notation with the digit count. Factorials themselves are on the factorial calculator, probabilities built from these counts on the probability calculator, and repeated trials on the binomial distribution calculator.

How to use the Permutation and Combination Calculator

  1. Enter nType the total number of items to choose from.
  2. Enter rType how many items are chosen or arranged.
  3. Read both countsSee nCr when order does not matter and nPr when it does.
  4. Check repetitionSee the counts when items may be used more than once, with every formula worked through.

Permutation and Combination Calculator features

  • nPr and nCr in one place
  • Permutations and combinations with repetition
  • Exact big-integer results
  • Formulas worked with your numbers
  • Handles n up to 100,000
  • Scientific notation for enormous answers
  • Runs entirely in your browser

Common uses

  • Counting lottery tickets and card hands
  • Probability and statistics homework
  • Counting passwords, PINs and codes
  • Planning tournament orders and seating
  • Checking combinatorics answers before an exam

Permutations and combinations in practice: PINs, teams, podiums and handshakes

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Counting problems ask how many ways something can happen, and the answer depends on whether order matters and whether repetition is allowed. Permutations count arrangements where order matters; combinations count selections where it does not. This guide shows how to decide which applies, with examples from PIN codes, race podiums, team selection, ice cream choices and handshakes, plus Pascal's triangle and the most common mistakes.

Four questions to ask

Before calculating, ask two questions. Does order matter? A podium of first, second and third is an ordered arrangement, while a committee of three people is not. Can items repeat? A PIN can use the same digit twice, while a person cannot win two places in one race. The answers decide which formula applies.

PIN codes

A 4-digit PIN with repetition allowed has 10 × 10 × 10 × 10 = 10,000 possibilities, because each position can be any of 10 digits. If no digit could repeat, there would be 10 × 9 × 8 × 7 = 5,040 possibilities, which is the permutation 10P4. Real PINs allow repetition, but many people choose patterns such as 1234 or birth years, which makes them far easier to guess than the 10,000 suggests.

Race podiums

In a race with 8 runners, the number of possible podiums for first, second and third is 8P3 = 8 × 7 × 6 = 336. Order matters here, because finishing first is different from finishing second. If you only cared about which three runners made the podium, regardless of position, there would be 8C3 = 56 possibilities, six times fewer, since each group of three can be ordered in 3! = 6 ways.

Choosing a team

Selecting players is a combination problem, because a team is a group, not an ordered list. Choosing 11 players from a squad of 15 can be done in 15C11 = 1,365 ways. If a captain must also be chosen from the 11, multiply by 11, giving 15,015 ways to pick a team and its captain.

A worked example: a committee with roles

A club of 12 members wants a committee of 3. If the three roles are identical, the number of possible committees is 12C3 = 220. If the roles are chairperson, secretary and treasurer, order matters, so there are 12P3 = 12 × 11 × 10 = 1,320 ways. The ratio between the two answers is 6, the number of ways to assign three roles to three chosen people.

Seeing the link between the two answers is a good way to check that you have chosen the right formula.

Combinations with repetition

Some selections allow repeats but ignore order, such as choosing 3 scoops of ice cream from 10 flavours where you can pick the same flavour more than once. The formula for such combinations gives C(10 + 3 − 1, 3) = C(12, 3) = 220 choices. Problems like this often confuse people because they combine features of both main cases.

The handshake problem

If 20 people at a meeting each shake hands with every other person once, the number of handshakes is 20C2 = 190. Each handshake is a pair of people, and the order of the two does not matter. The same calculation counts the matches in a round-robin tournament, where every team plays every other team once.

Pascal's triangle

The numbers in Pascal's triangle are combinations: the entries in row n are nC0, nC1, nC2 and so on. Each entry is the sum of the two above it, which gives a quick way to build combination values by hand. The triangle also gives the coefficients for expanding expressions such as (a + b)ⁿ.

Common mistakes

  • Using permutations for groups where order does not matter.
  • Forgetting whether repetition is allowed.
  • Multiplying by too many or too few factors in a permutation.
  • Double counting when roles or positions are involved.

Related tools

For factorials, use Factorial Calculator. For chances of events, try Probability Calculator, and for random selections, Random Number Generator.

From counting to probability

Counting gives probabilities directly: the probability of an event is the number of favourable outcomes divided by the total number of equally likely outcomes. Someone guessing a random 4-digit PIN with three attempts has a chance of 3 in 10,000, or 0.03%, which is why banks lock cards after a few wrong tries. The same reasoning gives the odds of lottery wins, poker hands and many other events.

Passwords and counting

Password strength is a counting problem too. An 8-letter password using only lower-case letters has 26⁸, about 209 billion, possibilities. Allowing upper-case letters and digits as well raises that to 62⁸, about 218 trillion, roughly a thousand times more. Adding length helps even more than adding character types, because each extra character multiplies the total again.

Seating and arrangements in a row

Arranging all items in a row is a permutation of every item, n!, while arranging only some of them is nPr. Five guests sitting in five chairs in a row can be seated in 5! = 120 ways, but choosing which 3 of 8 trophies to place on a shelf in a particular order gives 8P3 = 336 arrangements. Writing down how many choices exist for each position, then multiplying, is a reliable way to check any such answer.

Limits

Results are exact using big-integer arithmetic within the calculator's supported range.

Frequently asked questions

What is the difference between a permutation and a combination?

Order. A permutation counts arrangements where order matters, such as first, second and third place. A combination counts selections where it does not, such as a hand of cards. So there are always at least as many permutations as combinations.

What is the formula for nCr?

nCr = n! ÷ (r! × (n − r)!). For 5C2, that is 120 ÷ (2 × 6) = 10. It is also written C(n, r) or as n over r in brackets, and read as n choose r.

What is the formula for nPr?

nPr = n! ÷ (n − r)!, which equals n × (n − 1) × … for r factors. For 5P2, that is 5 × 4 = 20, twice 5C2, because each pair can be ordered in two ways.

How many lottery combinations are there for 6 numbers from 49?

49C6 = 13,983,816. Order does not matter in a lottery draw, so it is a combination. Your chance of matching all six with one ticket is therefore 1 in 13,983,816.

When do I use permutations with repetition?

When each position can take any of the n options regardless of earlier picks, such as digits in a PIN or letters in a code. A 4-digit PIN has 10⁴ = 10,000 possibilities.

What are combinations with repetition?

Selections where items may repeat and order does not matter, such as choosing 3 scoops from 10 flavours with repeats allowed. The count is C(n + r − 1, r), which is 220 for that example.

What happens if r is larger than n?

Without repetition you cannot choose more items than exist, so nPr and nCr are both 0. With repetition it is still possible, so those counts stay positive, as with a 6-digit code made from only 2 symbols.