Combination and Permutation Calculator

Calculate P(n,r) and C(n,r)

Frequently Asked Questions

A permutation counts ordered arrangements (ABC is different from BCA); a combination counts unordered selections (ABC and BCA are the same group). Permutations are always ≥ combinations for the same n and r.
P(n,r) = n! ÷ (n−r)!, the number of ways to arrange r items chosen from n distinct items, where order matters.
C(n,r) = n! ÷ (r! × (n−r)!), which equals P(n,r) ÷ r!. Order doesn't matter, so it's a smaller number than the equivalent permutation count.
When items can be reused, like a 4-digit PIN (10^4 possibilities) or a password where letters can repeat. That's simply n^r.

Permutation and combination formulas

TypeOrder matters?Repetition?Formula
PermutationyesnoP(n,r) = n! ÷ (n − r)!
CombinationnonoC(n,r) = n! ÷ (r! × (n − r)!)
Permutation with repetitionyesyesnr
Combination with repetitionnoyesC(n + r − 1, r)

Example with n = 10, r = 3

  • 720 permutations: ways to award gold, silver and bronze among 10 runners.
  • 120 combinations: ways to choose a 3-person committee from 10 people (720 ÷ 3!).
  • 1,000 permutations with repetition: 3-digit codes using digits 0 to 9.
  • 220 combinations with repetition: ways to pick 3 scoops from 10 ice cream flavors when you can repeat a flavor.

How to decide which one you need

Ask two questions. First, would swapping the order of the chosen items create a different outcome? If yes, use a permutation. Second, can the same item be chosen more than once? If yes, use the "with repetition" version.

Real-world examples

  • Lottery odds: Powerball draws 5 white balls from 69, order irrelevant: C(69,5) = 11,238,513. Multiply by 26 red balls to get 1 in 292,201,338.
  • Poker hands: C(52,5) = 2,598,960 possible five-card hands.
  • Passwords: an 8-character password from 62 letters and digits has 628, about 218 trillion, possibilities.
  • Seating: 6 guests in 6 chairs can be arranged 6! = 720 ways.

The calculator handles n up to 170; beyond that, factorials exceed the largest number a browser can store and the result shows as overflow. Very large results are shown rounded, so for exact digits of huge numbers use a computer algebra tool.

Turn counts into probabilities with the poker odds calculator and the Powerball payout calculator, or work with statistics in the sample size calculator.