Skip to content

Permutation and Combination Calculator — Free Online Tool

Calculate permutations (nPr) and combinations (nCr) simultaneously with step-by-step formulas, factorial breakdowns, and instant results.

Permutation (nPr)

720

Order matters

Combination (nCr)

120

Order does not matter

Permutation Formula

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

Combination Formula

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

n!

3,628,800

r!

6

(n-r)!

5,040

How to Use the Permutation and Combination Calculator

  1. Enter the total number of items (n): This is the size of the set you are choosing from. For example, if you have 10 students and want to form groups, n = 10. The maximum supported value is 170 (the limit of standard floating-point factorial calculations).
  2. Enter the number of items chosen (r): This is how many items you want to arrange or select. It must be between 0 and n (inclusive). For example, if forming a committee of 4 from 10 students, r = 4.
  3. Compare both results: The calculator shows both the permutation (nPr, where order matters) and the combination (nCr, where order does not matter) side by side. The permutation count is always greater than or equal to the combination count, with the ratio being exactly r!.
  4. Review the formulas: Both formulas are displayed with your specific values substituted, showing exactly how the calculation works. The individual factorial values (n!, r!, (n-r)!) are shown for verification.

The calculator updates results in real time as you adjust the inputs. If r exceeds n, a validation message appears since you cannot choose more items than are available.

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!

Variables Explained

  • n: The total number of items in the set. This is the pool from which you are choosing.
  • r: The number of items being chosen or arranged. Must satisfy 0 ≤ r ≤ n.
  • n!: n factorial — the product of all positive integers from 1 to n. For example, 5! = 120.
  • P(n, r) or nPr: The number of ordered arrangements of r items from n items.
  • C(n, r) or nCr: The number of unordered selections of r items from n items. Also written as "n choose r" or (n r) with parentheses.

Step-by-Step Example

A club has 12 members and needs to elect a president, vice president, and secretary. How many ways can this be done? Then, how many ways can a 3-person committee be selected (no specific roles)?

  1. Identify: n = 12, r = 3
  2. Permutation (roles assigned, order matters):
  3. P(12, 3) = 12! / (12-3)! = 12! / 9! = 12 × 11 × 10 = 1,320
  4. Combination (committee only, order irrelevant):
  5. C(12, 3) = 12! / (3! × 9!) = (12 × 11 × 10) / (3 × 2 × 1) = 1,320 / 6 = 220
  6. Verify: P(12,3) = C(12,3) × 3! = 220 × 6 = 1,320

There are 1,320 ways to assign three distinct roles from 12 members, but only 220 ways to form a generic 3-person committee. The ratio is 6 (which is 3!), because each group of 3 people can fill the 3 roles in 6 different ways.

Practical Examples

Example 1: Linda's Lottery Analysis

Linda wants to understand her chances in a lottery where she picks 6 numbers from 1 to 49. Since the order of the numbers drawn does not matter, this is a combination problem.

  • n = 49 (total numbers), r = 6 (numbers chosen)
  • C(49, 6) = 49! / (6! × 43!) = 13,983,816
  • Probability of winning: 1 / 13,983,816 ≈ 0.0000000715

There are nearly 14 million possible combinations. Linda's chance of winning is about 1 in 14 million, or 0.00000715%. Even buying 100 tickets only raises her probability to about 0.000715%. Understanding combinatorics helps put lottery odds in perspective.

Example 2: Mark's Tournament Scheduling

Mark is organizing a round-robin chess tournament with 8 players. Every player must play every other player exactly once. He needs to know how many games will be played.

  • Each game is a pair of players (order does not matter in pairing)
  • n = 8, r = 2
  • C(8, 2) = 8! / (2! × 6!) = (8 × 7) / 2 = 28 games

Mark needs to schedule 28 games. If the tournament uses ranked seeding (where player order matters, as in first-move advantage), he would use permutations: P(8, 2) = 56. But since chess alternates colors, the combination count of 28 is the correct number of unique matchups. He schedules 4 rounds of 4 simultaneous games, with a make-up round for any remaining matchups.

Example 3: Sofia's Password Strength Analysis

Sofia is evaluating password policies. She wants to know how many unique 4-character PINs can be created using digits 0-9, and how many 8-character passwords can be created from 62 characters (a-z, A-Z, 0-9), where order matters and repetition is allowed.

  • 4-digit PIN with repetition: 10⁴ = 10,000 possible PINs
  • 8-character password with repetition: 62⁸ = 218,340,105,584,896 possibilities
  • Without repetition (permutation): P(62, 8) = 136,325,893,334,400

A 4-digit PIN has only 10,000 possibilities and can be brute-forced instantly. An 8-character alphanumeric password has over 218 trillion possibilities with repetition, making it far more secure. Without repetition, there are still 136 trillion permutations. Sofia recommends a minimum 12-character password policy for the strongest security. For probability analysis of password guessing attacks, see our probability calculator.

Permutation and Combination Quick Reference

n r P(n,r) C(n,r)
522010
6312020
8333656
1045,040210
12595,040792
2051,860,48015,504
525311,875,2002,598,960

Tips and Complete Guide

The Order Question Decision Framework

When facing a counting problem, ask yourself: "If I rearrange the chosen items, do I get a different outcome?" If yes, use permutations. If no, use combinations. Assigning roles to people creates different outcomes when people swap roles (permutation). Selecting team members does not change when members are listed in a different order (combination). This single question resolves most counting problem ambiguities.

Permutations and Combinations with Repetition

The standard formulas assume items cannot be reused. When repetition is allowed, use: Permutations with repetition = n^r (n choices for each of r positions). Combinations with repetition = C(n+r-1, r). For example, choosing 3 scoops from 5 ice cream flavors with repetition allowed gives C(5+3-1, 3) = C(7, 3) = 35 ways, compared to C(5, 3) = 10 without repetition.

Pascal's Triangle and Combinations

Pascal's triangle provides all combination values arranged in a triangular pattern. Row n contains the values C(n, 0), C(n, 1), ..., C(n, n). Each entry is the sum of the two entries directly above it. This reveals important patterns: the symmetry C(n, r) = C(n, n-r), the sum of each row equals 2^n (total number of subsets), and the connection to the binomial theorem: (a+b)^n = Σ C(n,k) × a^(n-k) × b^k.

Common Mistakes to Avoid

  • Confusing "order matters" with "order of selection": The order of selection does not matter for permutations — what matters is whether the final arrangement is distinguishable. Choosing red, then blue is the same combination as blue, then red, but a different permutation only if positions matter.
  • Forgetting special cases: C(n, 0) = 1 (there is exactly one way to choose nothing), C(n, n) = 1 (one way to choose everything), and P(n, 0) = 1 (one way to arrange zero items — do nothing). These edge cases often trip up students.
  • Using the wrong formula when repetition is allowed: Standard nPr and nCr assume no repetition. If items can be reused (like digits in a PIN), you need the repetition formulas: n^r for ordered, C(n+r-1, r) for unordered.
  • Not simplifying before computing: Computing 52! directly for C(52,5) is unnecessary and prone to overflow. Instead, compute (52 × 51 × 50 × 49 × 48) / (5 × 4 × 3 × 2 × 1) = 2,598,960. Cancel common factors before multiplying.
  • Mixing up n and r: Always identify the total pool (n) and the selection size (r) clearly. In "choose 4 from 10", n = 10 and r = 4, not the other way around.

Frequently Asked Questions

The key difference is whether order matters. A permutation counts arrangements where order matters: choosing a president, vice president, and treasurer from 10 people gives 10 × 9 × 8 = 720 different arrangements. A combination counts selections where order does not matter: choosing any 3 people from 10 for a committee gives 10! / (3! × 7!) = 120 ways. The same set of 3 people counts as one combination but six different permutations (3! = 6 orderings).

Use permutations when the order or arrangement of items matters. Examples include rankings (1st, 2nd, 3rd place), codes (the PIN 1234 differs from 4321), assigning roles (president vs. secretary), and seating arrangements. Use combinations when only the selection matters, not the order. Examples include committee selection, lottery numbers (the same numbers win regardless of order), handshakes in a group, and choosing pizza toppings.

The permutation formula is nPr = n! / (n-r)!, where n is the total number of items and r is the number being arranged. This counts all ordered arrangements of r items from n total. For example, P(8,3) = 8! / 5! = 8 × 7 × 6 = 336. You can also think of it as: the first position has n choices, the second has n-1, the third has n-2, and so on for r positions.

The combination formula is nCr = n! / (r! × (n-r)!). This is the permutation formula divided by r! to remove duplicate orderings. For example, C(8,3) = 8! / (3! × 5!) = (8 × 7 × 6) / (3 × 2 × 1) = 336 / 6 = 56. A useful identity is that C(n,r) = C(n, n-r), meaning choosing 3 items from 8 gives the same count as choosing 5 items from 8.

Permutations always give a larger or equal count than combinations for the same n and r, because nPr = nCr × r!. Each combination of r items can be arranged in r! different orders, and each of those arrangements is a distinct permutation. For example, with n=5 and r=3: P(5,3) = 60 permutations, C(5,3) = 10 combinations, and 60 = 10 × 6 = 10 × 3!.

These counting methods are essential for calculating probabilities. The probability formula P(event) = favorable outcomes / total outcomes often requires counting outcomes using permutations or combinations. For example, the probability of getting 3 hearts in a 5-card poker hand is C(13,3) × C(39,2) / C(52,5). Without combinatorics, counting these outcomes directly would be practically impossible for complex scenarios.

Factorials grow extremely fast: 20! already exceeds 2 quintillion. Our calculator handles values up to n = 170 using standard floating-point arithmetic, which covers most practical applications. For larger values, the results may show scientific notation or indicate infinity. In practice, most real-world problems involve manageable numbers. If you need exact results for very large factorials, our factorial calculator supports values up to 1000 using arbitrary-precision arithmetic.

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026

Sources