Skip to content
FigureSure
Sign in

Permutation and Combination Calculator

Count permutations (nPr) and combinations (nCr), with or without repetition. Results are exact whole numbers, even when they run to thousands of digits, and the formula is shown with your numbers substituted.
  • Updated
  • Formula shown

Items and choices

How many different items you choose from

How many you pick

Does the order matter?
Can an item be chosen more than once?

Results

Combinations C(10, 3)
120
n! ÷ (r! × (n − r)!) · 3 digits
Permutations P(10, 3)
n! ÷ (n − r)! · if the order mattered
720
Orderings of each selection
r! = 3!: P(n, r) = C(n, r) × r!
6

Combinations C(10, 3) = 120

Formula with your numbers
CountWorking
CombinationsC(10, 3) = 10! ÷ (3! × 7!) = (10 × 9 × 8) ÷ (3 × 2 × 1) = 120
Permutations (for comparison)P(10, 3) = 10! ÷ (10 − 3)! = 10! ÷ 7! = 10 × 9 × 8 = 720

How to use the calculator

  1. Enter n, the number of different items to choose from, and r, the number you pick.
  2. Say whether the order matters. If it does (rankings, codes, seating), you want permutations; if not (teams, hands of cards), combinations.
  3. Say whether an item can be picked more than once, as with digits in a PIN.
  4. Both counts are shown so you can compare them; the one you asked for is highlighted. Long exact answers can be copied in full.

Permutation and combination formulas

Permutations: P(n, r) = n! ÷ (n − r)!
Combinations: C(n, r) = n! ÷ (r! × (n − r)!)
Permutations with repetition: nʳ
Combinations with repetition: C(n + r − 1, r) = (n + r − 1)! ÷ (r! × (n − 1)!)

n! ("n factorial") is n × (n − 1) × … × 2 × 1, and 0! = 1. Each combination of r items can be arranged in r! orders, so P(n, r) = C(n, r) × r!. The repetition formula for combinations is the "stars and bars" count: choosing r items from n types with repeats is the same as placing r stars among n − 1 dividers. The calculator multiplies whole numbers with BigInt arithmetic, so a result like C(100, 50) is exact to the last digit rather than rounded.

Worked example

Eight runners compete for gold, silver and bronze. Order matters, so the count is P(8, 3) = 8! ÷ 5! = 8 × 7 × 6 = 336. If instead the top three simply qualify for the final, order does not matter: C(8, 3) = 8! ÷ (3! × 5!) = 336 ÷ 6 = 56. Each group of three qualifiers can be arranged on the podium in 3! = 6 ways, which is exactly the factor between the two answers.

Common counting problems

ProblemFormulaCount
Podium places (gold, silver, bronze) among 8 runnersP(8, 3)336
A committee of 3 from 8 peopleC(8, 3)56
Tickets in a 6-from-49 lotteryC(49, 6)13,983,816
Five-card poker hands from 52 cardsC(52, 5)2,598,960
Four-digit PIN codes (digits may repeat)10⁴10,000
Three scoops from 5 flavours, repeats allowedC(7, 3)35
Ways to seat 10 guests in a row10!3,628,800
Six-character passwords from 26 lower-case letters26⁶308,915,776
Orderings of a 52-card deck52!≈ 8.0658 × 10⁶⁷

A probability follows directly: one ticket in a 6-from-49 lottery wins the jackpot with probability 1 ÷ 13,983,816. The probability calculator handles the next steps, such as the chance of winning at least once in many draws.

Pascal's triangle

Row n of Pascal's triangle lists C(n, 0), C(n, 1), …, C(n, n). Each entry is the sum of the two above it, because C(n, r) = C(n − 1, r − 1) + C(n − 1, r), and the entries of row n add up to 2ⁿ, the number of subsets of n items.

nC(n, 0) … C(n, n)
01
11 1
21 2 1
31 3 3 1
41 4 6 4 1
51 5 10 10 5 1
61 6 15 20 15 6 1
71 7 21 35 35 21 7 1
81 8 28 56 70 56 28 8 1
91 9 36 84 126 126 84 36 9 1
101 10 45 120 210 252 210 120 45 10 1

Tips: which one do I need?

  • Ask "would swapping two choices make a different outcome?" If yes (first and second place, the digits of a code), order matters: permutations.
  • A "combination lock" is really a permutation with repetition: 1-2-3 and 3-2-1 open different locks, and digits can repeat.
  • Choosing r is the same as leaving out n − r, so C(n, r) = C(n, n − r). C(52, 47) equals C(52, 5).
  • Watch the size. Factorials grow very fast: 20! already has 19 digits and 70! has 101. Use the exact output rather than copying a rounded calculator display.

For other very large exact results, the big number calculator keeps every digit, and the scientific notation calculator converts them to a compact form.

Frequently asked questions

What is the difference between a permutation and a combination?

In a permutation the order matters; in a combination it does not. Choosing 3 of 10 people gives C(10, 3) = 120 possible groups, but there are P(10, 3) = 720 ways to award gold, silver and bronze, because each group can be ordered 3! = 6 ways.

What is the formula for combinations?

C(n, r) = n! ÷ (r! × (n − r)!). A lottery that draws 6 numbers from 49 has C(49, 6) = 13,983,816 possible tickets, so one ticket has a 1 in 13,983,816 chance of matching all six.

How do you count when repetition is allowed?

If order matters, there are nʳ choices: a 4-digit PIN has 10⁴ = 10,000 possibilities. If order does not matter, use C(n + r − 1, r): choosing 3 scoops from 5 flavours, repeats allowed, gives C(7, 3) = 35 different cups.

Why does 0! equal 1?

There is exactly one way to arrange nothing, and defining 0! = 1 keeps the formulas consistent. It makes C(n, 0) = C(n, n) = 1: there is one way to choose nobody and one way to choose everybody.

How many ways can a deck of cards be shuffled?

A 52-card deck can be ordered in 52! ≈ 8.0658 × 10⁶⁷ ways, a 68-digit number. By contrast, there are only C(52, 5) = 2,598,960 different five-card poker hands, because the order of the cards in a hand does not matter.

Was this calculator helpful?