Permutation and Combination Calculator

Calculate permutations P(n,r) and combinations C(n,r) with factorial formulas.

Max 20 for exact results

Permutation P(n,r): Order matters

720

P(10,3) = 10! / (10-3)! = 10! / 7!

Combination C(n,r): Order does not matter

120

C(10,3) = 10! / [3! × (10-3)!] = 10! / [3! × 7!]

10! = 3628800

3! = 6

(10-3)! = 7! = 5040

How to Use the Permutation and Combination Calculator

This permutation and combination calculator (also used as an nCr calculator, nPr calculator, or "choose" calculator) returns both ordered arrangements and unordered selections for any n and r you enter. If you need to know how to calculate permutations or how to calculate combinations for a problem, enter the two numbers below and the result panel shows the P(n, r) and C(n, r) values with the factorial breakdown.

  1. Enter n, the total number of items in the set. If you have 10 candidates for 3 open roles, n = 10. If you are drawing from a 52-card deck, n = 52 (use the worked tables below when n exceeds the calculator cap of 20).
  2. Enter r, the number of items being chosen or arranged. For 3 roles chosen from 10 candidates, r = 3. r must be less than or equal to n when drawing without replacement.
  3. Decide whether order matters. If swapping two picks gives a different outcome (first, second, third place in a race), use the permutation. If swapping does not change the result (three names pulled for a committee), use the combination.
  4. Decide whether replacement applies. If the same item can be picked more than once (digits in a PIN, letters in a password), you are dealing with a "with replacement" problem. If each pick removes the item from the pool (cards dealt, people seated), it is "without replacement."

Read the two result cards side by side. The permutation count is always larger than or equal to the combination count, and the ratio between them is exactly r!. A large permutation number means the arrangement carries a lot of information (unique passwords, race results). A large combination number means there are many possible groups (poker hands, lottery tickets) even when the order of the picks is irrelevant.

n is capped at 20 in the widget because factorials grow extremely fast: 20! = 2,432,902,008,176,640,000, which is the largest exact integer most calculators track. For n above 20, use the formulas further down the page or work in scientific notation.

Permutation and Combination Formulas

Permutation (order matters):
  P(n, r) = n! / (n - r)!

Combination (order does not matter):
  C(n, r) = n! / [r! × (n - r)!]

Relationship: P(n, r) = C(n, r) × r!
  Each combination can be arranged in r! ways to form permutations.

Example with n=10, r=3:
  P(10, 3) = 10! / 7! = (10×9×8×7!) / 7! = 10×9×8 = 720
  C(10, 3) = 10! / (3! × 7!) = 720 / 6 = 120

Memory tip:
  P for Positions (order matters)
  C for Committee (order doesn't matter)
  C = P / r! because dividing by r! removes order

Factorial Definition

A factorial n! is the product of every positive integer from 1 up to n. Factorials are the building block of every permutation and combination formula:

n! = n × (n − 1) × (n − 2) × ... × 2 × 1

0! = 1   (by convention, the empty product)
1! = 1
2! = 2 × 1 = 2
3! = 3 × 2 × 1 = 6
4! = 4 × 3 × 2 × 1 = 24
5! = 5 × 4 × 3 × 2 × 1 = 120
10! = 3,628,800
20! = 2,432,902,008,176,640,000

The 0! = 1 rule looks strange but is needed so that C(n, 0) = 1 and C(n, n) = 1 fall out of the formula naturally. There is exactly one way to choose nothing and exactly one way to choose everything.

Permutation Without Replacement: P(n, r) = n! / (n − r)!

Use this when the order of selection matters and each item can only be picked once. This is the standard nPr calculator formula, also written P(n, r), nPr, or n P r.

P(n, r) = n! / (n − r)!

P(10, 3) = 10! / 7!
         = (10 × 9 × 8 × 7!) / 7!
         = 10 × 9 × 8
         = 720

Cancelling the (n − r)! in the numerator is the shortcut that makes permutations easy to compute by hand: only multiply the top r numbers of n!.

Combination Without Replacement: C(n, r) = n! / (r!(n − r)!)

Use this when order does not matter and each item can only be picked once. This is the nCr calculator formula, also called "n choose r" and written C(n, r), nCr, or (nr).

C(n, r) = n! / [r! × (n − r)!]

C(10, 3) = 10! / (3! × 7!)
         = 720 / 6
         = 120

Permutation With Replacement: nr

Use this when order matters and each item can be picked more than once. A 4-digit PIN is a permutation with replacement of 10 digits taken 4 at a time.

P'(n, r) = n^r

4-digit PIN:        10^4  = 10,000
6-letter password:  26^6  = 308,915,776
3 coin flips:       2^3   = 8

Combination With Replacement: C(n + r − 1, r)

Use this when order does not matter and each item can be picked more than once. A classic example is choosing 3 scoops of ice cream from 5 flavors where you are allowed to repeat flavors.

C'(n, r) = C(n + r − 1, r) = (n + r − 1)! / [r! × (n − 1)!]

3 scoops from 5 flavors (repeats allowed):
C(5 + 3 − 1, 3) = C(7, 3) = 35

Worked Example 1: Picking 3 of 5 Books in Order

You have 5 books on a shelf and want to place 3 of them, left to right, on a display. Order matters because position 1, 2, and 3 are distinct spots. Each book is picked once.

P(5, 3) = 5! / (5 − 3)!
        = 5! / 2!
        = 120 / 2
        = 60

There are 60 ordered arrangements.

Worked Example 2: Choosing 3 of 5 Books (Order Does Not Matter)

Same 5 books, but now you are picking 3 to take on a trip. It does not matter which one you pack first. This is a combination.

C(5, 3) = 5! / [3! × (5 − 3)!]
        = 120 / (6 × 2)
        = 120 / 12
        = 10

There are 10 possible sets of 3 books.

Notice the relationship: 60 ÷ 10 = 6 = 3!. Every combination of 3 books can be arranged in 3! = 6 orderings, which is why the permutation count is exactly r! times the combination count.

Quick Reference Table: P(n, r) and C(n, r) for Common Pairs

nrP(n, r)C(n, r)
522010
536010
551201
1029045
103720120
10530,240252
202380190
2036,8401,140
2051,860,48015,504
5222,6521,326
523132,60022,100
525311,875,2002,598,960

The n = 52, r = 5 row is the classic poker count: 2,598,960 distinct 5-card hands out of a standard deck.

Permutations and Combinations in the Real World

Knowing the permutation and combination formulas is only half the battle. The harder part is deciding which one applies. This section covers the two biggest decisions (does order matter, does replacement apply), shows real-world counts you can check yourself, and flags the mistakes that quietly double or halve the answer.

When Order Matters vs When It Does Not

The single test is: if you swap two items in your picked group, is it a different outcome? If yes, order matters and you need a permutation. If no, order does not matter and you need a combination. A few side-by-side examples:

ScenarioOrder Matters?Formula
Horse race podium (1st, 2nd, 3rd of 8 horses)YesP(8, 3) = 336
Lottery numbers (5 of 69)NoC(69, 5) = 11,238,513
Seating 4 people in 4 chairsYesP(4, 4) = 24
Picking 4 starters from a team of 12NoC(12, 4) = 495
4-digit PIN (digits 0 to 9, repeats allowed)Yes (with replacement)104 = 10,000
Password "pick 6 of 26 letters, no repeats"Yes (no replacement)P(26, 6) = 165,765,600

A seating chart is a permutation because moving person A from chair 1 to chair 3 produces a new arrangement. Team selection is a combination because swapping which starter gets announced first does not change who is on the field.

Real-World Counts You Can Verify

These are the numbers most often looked up. Each one drops out of the formulas above.

QuestionCalculationResult
Powerball jackpot oddsC(69, 5) × 261 in 292,201,338
Mega Millions jackpot oddsC(70, 5) × 251 in 302,575,350
5-card poker handsC(52, 5)2,598,960
Full deck arrangements (shuffles)52!8.07 × 1067
4-digit PIN with repeats10410,000
Rubik's cube positions43,252,003,274,489,856,000~4.3 × 1019

The Powerball figure is worth unpacking. The white ball draw picks 5 of 69 without order, which is C(69, 5) = 11,238,513. The red Powerball is 1 of 26. Multiply to get 11,238,513 × 26 = 292,201,338 possible tickets, which is why the published odds of the jackpot are 1 in 292,201,338. The number of ways to shuffle a 52-card deck, 52! ≈ 8 × 1067, is larger than the number of atoms in the Milky Way galaxy, which means every well-shuffled deck is almost certainly an arrangement never seen before.

Common Traps That Silently Change the Answer

Three mistakes account for almost every wrong answer on probability and counting homework:

  1. Treating a combination as a permutation. Counting a 5-person committee as P(20, 5) = 1,860,480 instead of C(20, 5) = 15,504 over-counts by a factor of 5! = 120. Every committee is counted once for each of its orderings. If the roles inside the committee do not matter, divide by r!.
  2. Forgetting the replacement rule. Drawing 3 cards from a deck one at a time without putting them back is P(52, 3) = 132,600, but rolling a 6-sided die 3 times is 63 = 216 because the die resets every roll. A binary sequence of 10 flips is 210= 1,024, not C(10, 2) or anything else. When items can repeat, switch to the "with replacement" formula.
  3. Mixing the boundary cases. C(n, 0) = 1 and C(n, n) = 1. C(10, 10) is one, not ten. There is exactly one way to pick all ten items. This matters when you sum a binomial expansion: the endpoints contribute 1 each, not 0.

The P and C Relationship: P(n, r) = C(n, r) × r!

Every permutation is a combination that has been put in an order. Pick the group first (C(n, r) ways), then arrange that group (r! ways). Multiply and you get the permutation count.

P(10, 3) = C(10, 3) × 3!
         = 120 × 6
         = 720

P(52, 5) = C(52, 5) × 5!
         = 2,598,960 × 120
         = 311,875,200

This is why professional statisticians almost always compute C(n, r) first, then multiply by r! if they need the ordered count. The combination is the "shape" of the selection. The factorial is the "arrangement" of that shape.

Frequently Asked Questions

A permutation counts arrangements where order matters. A combination counts selections where order does not matter. Example: choosing 3 letters from A, B, C, D. The permutation ABC is different from BAC because the order changed. The combination {A, B, C} is the same as {B, A, C} because the same letters were chosen regardless of order. P(4,3) = 24, C(4,3) = 4.

Related Calculators