Skip to content

Permutation and Combination Calculator: nPr and nCr

Calculate permutations (nPr) and combinations (nCr) exactly, even for large n. Learn when order matters, the factorial formulas and lottery, card and team examples.

3 min read

How many ways can you choose a team of 3 from 10 people? How many different podium finishes are possible in a race? Questions like these are about counting arrangements, and the answers come from permutations and combinations. Our permutation and combination calculator gives both values exactly, even when they run into billions. This guide explains the difference and the formulas behind them.

How to use the calculator

  1. n (total): how many items you choose from.
  2. r (chosen): how many you pick.

With the defaults, n = 10 and r = 3:

  • Combinations nCr: 120
  • Permutations nPr: 720

Does order matter?

This is the key question.

  • Permutations: order matters. Gold, silver and bronze for Ann, Ben and Cal is different from gold, silver and bronze for Cal, Ben and Ann.
  • Combinations: order does not matter. A committee of Ann, Ben and Cal is the same committee whichever order you name them.

Because each group of 3 can be arranged in 3 × 2 × 1 = 6 orders, there are 6 times as many permutations as combinations: 720 ÷ 6 = 120.

The formulas

Both use factorials, written n! and meaning n × (n − 1) × … × 1. So 5! = 120 and 0! = 1 by definition.

Permutations, 10P3: 10! ÷ 7! = 10 × 9 × 8 = 720. There are 10 choices for first place, 9 for second and 8 for third.

Combinations, 10C3: 720 ÷ 3! = 720 ÷ 6 = 120.

Worked examples

Lottery (6 from 49). Order does not matter: 49C6 = 13,983,816. One ticket has about a 1 in 14 million chance of the jackpot.

Poker hands. The number of 5-card hands from a 52-card deck is 52C5 = 2,598,960. If the order in which cards are dealt mattered, it would be 52P5 = 311,875,200.

PIN codes. A 4-digit PIN with no repeated digits: 10P4 = 10 × 9 × 8 × 7 = 5,040. With repeats allowed, it is 10⁴ = 10,000. That is not a permutation, because the same digit can be chosen more than once.

Pizza toppings. Choosing 3 toppings from 12: 12C3 = 220 different pizzas.

Seating. Arranging 5 people in a row of 5 chairs: 5P5 = 5! = 120 ways.

Quick reference

SituationUse
Rankings, races, passwords, seatingPermutation
Teams, committees, lottery tickets, hands of cardsCombination
Items can repeat (like PIN digits)nʳ

Useful properties

  • nC0 = nCn = 1: there is one way to choose nothing or everything.
  • nCr = nC(n − r): choosing 3 from 10 to include is the same as choosing 7 to leave out, so 10C3 = 10C7 = 120.
  • Pascal's triangle: each entry is nCr, and each is the sum of the two above it.
  • nPn = n!: the number of ways to arrange all n items.

Why the numbers get so big

Factorials grow astonishingly fast. 20! is about 2.4 × 10¹⁸, and 52! (the ways to shuffle a deck) has 68 digits. Ordinary calculators lose precision long before then. This calculator uses exact whole-number arithmetic. For even bigger values, the big number calculator and scientific notation calculator help.

From counting to probability

Probability is often favourable outcomes ÷ total outcomes. The chance of being dealt four aces in a 5-card hand is 48 ÷ 2,598,960 (there are 48 choices for the fifth card), about 1 in 54,145. The probability calculator combines probabilities of separate events, and the random number generator can simulate draws.

Frequently asked questions

What is the easiest way to remember the difference?

Permutation, position: order matters. Combination, committee: order does not matter.

Why is 0! equal to 1?

There is exactly one way to arrange nothing. Defining 0! = 1 also keeps the formulas working when r = 0 or r = n.

Can r be larger than n?

No. You cannot choose more items than there are, so nPr and nCr are zero or undefined when r is greater than n.

What about repeats?

The calculator assumes each item is used at most once. If repeats are allowed and order matters, the count is n raised to the power r.

Share

Try it yourself

Run your own numbers with our free tool: Permutation & combination calculator. No sign-up, and it works on any device.

Open the calculator