Mathematics

Permutation & Combination Calculator

Calculate permutations and combinations for selecting or arranging items from a set.

Combinations (nCr)

120

Ways to select 3 items from 10 where order does not matter.

Permutations (nPr)720
n! (factorial)3,628,800
r! (factorial)6
(n-r)! (factorial)5,040

Combinations: order does not matter (selecting a team). Permutations: order does matter (arranging in a line).

What is the Permutation and Combination Calculator?

Permutations and combinations are fundamental counting principles. A permutation (nPr) counts the number of ways to arrange r items chosen from n total items, where order matters—like seating people in specific chairs. A combination (nCr) counts the number of ways to select r items from n items where order does not matter—like choosing team members. Both use factorial notation: nPr = n!/(n-r)! and nCr = n!/(r!(n-r)!).

How it works

Enter your total number of items (n) and the number of items you're selecting or arranging (r). The calculator verifies that r is not greater than n, then computes both formulas: nPr by dividing n! by (n-r)!, and nCr by dividing n! by the product of r! and (n-r)!. Factorials are computed by multiplying all positive integers up to that number.

nPr = n! / (n-r)! | nCr = n! / (r! × (n-r)!)

n! (n factorial) = n × (n-1) × (n-2) × ... × 1. For permutations, divide n! by (n-r)! to account for arrangements. For combinations, divide by both r! and (n-r)! to eliminate duplicate selections where order doesn't matter. The extra r! in the denominator of nCr accounts for the fact that each selection can be arranged r! ways, but those arrangements are counted as identical.

Examples

InputResultNotes
n = 5, r = 3nCr = 10 combinations, nPr = 60 permutationsSelecting 3 from 5 items: 10 different groups (ABC, ABD, ABE, ACD, ACE, ADE, BCD, BCE, BDE, CDE). Arranging 3 from 5: 60 different sequences because each group can be ordered 6 ways (3! = 6).
n = 10, r = 3nCr = 120 combinations, nPr = 720 permutationsSelecting 3 lottery numbers from 10: 120 ways. Arranging 3 runners in a race from 10 competitors: 720 ways (first place has 10 choices, second has 9, third has 8).
n = 7, r = 2nCr = 21 combinations, nPr = 42 permutationsChoosing 2 toppings from 7 pizza toppings: 21 combinations. Assigning first and second prize from 7 contestants: 42 permutations.

How to use the Permutation and Combination Calculator

  1. Identify your total number of items and call it n.
  2. Identify how many items you're selecting or arranging and call it r.
  3. Confirm that r is not greater than n (you cannot select more items than you have).
  4. Enter n and r into the calculator.
  5. Read nCr (combinations) if order does not matter, or nPr (permutations) if order does matter.
  6. Review the factorial breakdown (n!, r!, (n-r)!) to understand the computation.
  7. Use this count for probability calculations, counting outcomes, or lottery odds.

Benefits

  • Eliminates tedious factorial hand-calculations for large numbers.
  • Instantly disambiguates between ordered (permutation) and unordered (combination) scenarios.
  • Shows intermediate factorials so you can verify or understand the math.
  • Enforces the constraint that r must not exceed n, preventing nonsensical inputs.
  • Useful for probability, statistics, combinatorics, and discrete maths problems.
  • Free and browser-based; no software installation or subscriptions needed.

Tips & common mistakes

Common mistakes

  • Confusing permutations with combinations—use permutations when order matters (ranks, races, passwords), combinations when it doesn't (teams, lottery, groups).
  • Entering r greater than n (you cannot choose 5 items from a set of 3)—the calculator rejects this automatically.
  • Forgetting that 0! = 1, not 0—this affects calculations when n-r equals zero.

Tips

  • If in doubt whether order matters, ask: 'Does ABC differ from BAC?' If yes, use permutations; if no, use combinations.
  • Combinations are always smaller than or equal to their corresponding permutations (nCr ≤ nPr) because combinations group identical orderings together.
  • For password strength, use permutations: a 4-digit PIN from digits 0-9 is 10P4 = 5,040 possibilities (order absolutely matters).

Frequently asked questions

What is the difference between a permutation and a combination?

In a permutation, order matters—ABC is different from BAC. In a combination, order does not matter—ABC and BAC are the same selection. Use permutations for rankings, sequences, or arrangements; use combinations for teams, committees, or unordered selections.

Why is nCr always less than or equal to nPr?

Because combinations count each unique selection once, while permutations count all possible orderings of that selection. If you have 3 items, there are 3! = 6 ways to arrange them, so nCr is typically r! times smaller than nPr.

What does it mean if r = n?

If r equals n, you are selecting or arranging all items. nCr = 1 (only one way to select everything), and nPr = n! (all possible orderings of all items).

Can r be zero?

Yes. Selecting zero items from n items (nC0) always equals 1 because there is exactly one way to select nothing. Similarly, arranging zero items (nP0) equals 1.

How do I use this for lottery odds?

If a lottery asks you to pick 6 numbers from 49, that is a combination: 49C6 ≈ 10 million. Your odds of winning with one ticket are 1 in 10 million. Use combinations because the order you pick the numbers does not affect the outcome.

What if n or r is very large?

Factorials grow very fast. Even 20! exceeds 2 quintillion. For very large values, approximations (Stirling's formula) may be used, but this calculator computes exact values up to practical limits.

Related tools

FreeToolz Editorial Team · Last reviewed July 2026

Reviewed for accuracy. Results are estimates for general information and are not professional (medical, financial or legal) advice.