Skip to content

Permutation and Combination Calculator

Calculate permutations (nPr) and combinations (nCr) with step-by-step factorial breakdown. Supports large numbers up to n=170.

Permutations vs Combinations

Both count ways to select r items from a set of n items. The difference is whether order matters.

Permutation Formula (nPr)

Order matters. The number of ordered arrangements of r items from n:

nPr = n! / (n − r)!

Example: How many ways can 3 runners finish 1st, 2nd, 3rd from 8 contestants?

  • 8P3 = 8! / 5! = 8 × 7 × 6 = 336

Combination Formula (nCr)

Order does not matter. The number of ways to choose r items from n:

nCr = n! / (r! × (n − r)!)

Example: How many ways to pick a 3-person committee from 8 people?

  • 8C3 = 8! / (3! × 5!) = 336 / 6 = 56

Relationship Between nPr and nCr

Since combinations ignore order, nCr = nPr / r!. Every combination corresponds to r! permutations (all the rearrangements of the same r items).

Common Examples

ScenarioTypeFormulaResult
Lottery: pick 6 from 49Combination49C613,983,816
4-digit PIN (0-9)Permutation10P45,040
Poker hand (5 from 52)Combination52C52,598,960
Podium (top 3 of 20)Permutation20P36,840
Team of 4 from 15Combination15C41,365

Special Cases

  • nP0 = 1: There is exactly one way to arrange zero items
  • nPn = n!: Arranging all items is the full factorial
  • nC0 = nCn = 1: One way to choose nothing or everything
  • nC1 = n: Choosing 1 item from n gives n options
  • nCr = nC(n−r): Choosing r items to include is the same as choosing n−r to exclude

With Repetition

The formulas above assume items are selected without replacement. With repetition:

  • Permutations with repetition: nr (e.g., 4-digit PIN with repeats: 10&sup4; = 10,000)
  • Combinations with repetition: (n + r − 1)! / (r! × (n − 1)!)

Related Calculators

Frequently Asked Questions

What is the difference between permutation and combination?

Permutations count arrangements where order matters (ABC ≠ BAC). Combinations count selections where order does not matter (ABC = BAC). Permutations are always ≥ combinations for the same n and r.

When do I use permutations?

Use permutations when order matters: rankings, passwords, seating arrangements, race finishing positions, PIN codes, phone numbers.

When do I use combinations?

Use combinations when order does not matter: lottery numbers, committee selection, choosing a hand of cards, picking team members.

What does n! (factorial) mean?

n! means n × (n-1) × (n-2) × ... × 2 × 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1.

What is the maximum n this calculator supports?

This calculator supports n up to 170 using BigInt arithmetic for exact results, even when the numbers have dozens of digits.