Math

Permutation & Combination Calculator

Calculate permutations (nPr) and combinations (nCr) instantly for any n and r. Free to use, no sign-up.

Did this calculator help you?

What is Permutation & Combination Calculator?

Permutations and combinations are the two fundamental ways of counting how many ways you can select or arrange items from a larger set — a cornerstone of probability, statistics, and combinatorics. A permutation, written P(n,r) or nPr, counts the number of ways to arrange r items chosen from n, where the order of selection matters. A combination, written C(n,r) or nCr, counts the number of ways to choose r items from n, where order doesn't matter. This calculator computes both using exact arbitrary-precision arithmetic, so results stay perfectly accurate even for large factorials.

When to Use This Calculator

  • Count the number of possible arrangements, passwords, schedules, or ranking orders
  • Find how many committees, teams, or selections can be formed from a group
  • Calculate lottery, raffle, or contest odds by counting favorable outcomes
  • Expand binomial expressions and read coefficients from Pascal's Triangle
  • Solve probability and combinatorics homework problems step by step
  • Check the total number of outcomes in games of chance before computing probabilities

Steps:

  1. Enter n, the total number of items in the set.
  2. Enter r, the number of items you're selecting.
  3. The calculator computes both P(n,r) and C(n,r) using the factorial formulas.
  4. Review the full step-by-step breakdown of each formula.

Formula

Permutation: P(n,r) = n! / (n-r)! Combination: C(n,r) = n! / (r!(n-r)!) Where n! (n factorial) = n × (n-1) × (n-2) × ... × 2 × 1

Use Cases

  • Calculating lottery or raffle odds
  • Solving probability and combinatorics homework
  • Counting possible passwords, PINs, or arrangements
  • Determining the number of possible committees, teams, or groupings

Key Benefits

  • Computes both permutations and combinations in one place
  • Exact results using arbitrary-precision arithmetic — no rounding errors on large numbers
  • Full step-by-step breakdown of the factorial formulas
  • Clear explanation of when to use each formula

Pro Tips

  • Ask yourself "does the order matter?" first — that single question determines whether to use permutations or combinations
  • For large n and small r, it's faster to compute C(n,r) as n×(n-1)×...×(n-r+1) / r! rather than using full factorials
  • Committee, team, or group selection problems are almost always combinations
  • Ranking, arranging, or ordering problems (like race results or seating) are almost always permutations

Common Mistakes to Avoid

  • Using the permutation formula when order doesn't actually matter in the problem (or vice versa)
  • Forgetting that r cannot exceed n
  • Miscounting when a problem allows repetition — these formulas assume items are chosen without repetition
  • Confusing nPr and nCr notation when reading a textbook or exam question

Key Terms Explained

Factorial (n!): The product of all positive integers up to n
Permutation: An ordered arrangement of a subset of items
Combination: An unordered selection of a subset of items
Binomial Coefficient: Another name for C(n,r), written as (n choose r)

Related Concepts

Example

For n=10, r=3: P(10,3) = 10!/(10-3)! = 10 × 9 × 8 = 720 ways to arrange 3 items from 10 in order. C(10,3) = 10!/(3!×7!) = 720/6 = 120 ways to choose 3 items from 10 without regard to order.

Interpreting Your Results

Read the permutation P(n,r) as the number of ordered arrangements of r items drawn from n, where swapping two chosen items creates a new result. Read the combination C(n,r) as the number of unordered selections, where the same set of items counts once regardless of order. A larger result means more distinct outcomes are possible, which lowers the probability of any single outcome when everything is equally likely. When r is close to n, C(n,r) equals C(n, n-r) and stays small, while when r is in the middle, the count peaks.

Frequently Asked Questions

What's the difference between a permutation and a combination?
In a permutation, order matters — arranging A, B, C differently counts as different outcomes. In a combination, order doesn't matter — choosing the same set of items in any order counts as one outcome. Permutations always give a result greater than or equal to combinations for the same n and r.
What does P(n,r) mean?
P(n,r), also written nPr, is the number of ways to arrange r items selected from a set of n items, where the order of selection matters. It's calculated as n! / (n-r)!.
What does C(n,r) mean?
C(n,r), also written nCr or "n choose r," is the number of ways to select r items from a set of n items where order doesn't matter. It's calculated as n! / (r!(n-r)!).
Why is 0! equal to 1?
By mathematical convention, 0! = 1. This isn't arbitrary — it makes the permutation and combination formulas produce correct results (like C(n,0) = 1, meaning there's exactly one way to choose nothing) and is consistent with the recursive definition n! = n × (n-1)!.
How do I count arrangements when items can repeat?
When repetition is allowed, every position has n choices, so the number of ordered arrangements is n to the power of r, written n^r. For example, a 4-digit PIN where digits can repeat gives 10^4 = 10000 possible codes, because each of the 4 positions has 10 digit choices (0 through 9). This counts far more arrangements than the regular permutation formula, which forbids repeats.
How do I arrange every item in the set?
Arranging all n items uses the full permutation n!, meaning n × (n-1) × (n-2) × ... × 1. For example, 5 different books on a shelf can be ordered in 5! = 5 × 4 × 3 × 2 × 1 = 120 ways. The first position has 5 choices, the second has 4 remaining, and so on, so the total is the product of all the descending integers down to 1.
What happens when r is larger than n?
When r > n you cannot select more items than the set contains without repetition, so both results are zero: P(n,r) = 0 and C(n,r) = 0. For example, choosing 5 people from a group of 3 is impossible, giving 0 permutations and 0 combinations. The formulas return zero automatically because the factorial in the denominator grows past the numerator.
What is the difference between selecting with and without repetition?
Selecting with repetition (or with replacement) means the same item can be chosen again, which is allowed for PINs, dice rolls, and passwords. Selecting without repetition means each item can be used only once, like picking winners from a pool of contestants. The regular permutation and combination formulas P(n,r) and C(n,r) always assume no repetition; for repetition use n^r for ordered arrangements or the stars-and-bars formula C(n + r - 1, r) for unordered ones.
How do I know whether to use a permutation or a combination?
Ask whether the order of selection matters. If it does, use a permutation; if it does not, use a combination. Choosing a president, vice president, and treasurer from 10 people is a permutation because each office is distinct: P(10,3) = 720. Choosing a 3-person committee from the same 10 people is a combination because the committee has no ranks: C(10,3) = 120.
How are combinations connected to Pascal's Triangle?
Each row of Pascal's Triangle lists the combination values C(n,r) for a fixed n. Row 4 reads 1, 4, 6, 4, 1, which are C(4,0), C(4,1), C(4,2), C(4,3), and C(4,4). Because C(n,r) is the binomial coefficient, it also gives the coefficients in expansions such as (a + b)^4 = a^4 + 4a^3b + 6a^2b^2 + 4ab^3 + b^4. Each number in the triangle is the sum of the two numbers above it, which is why C(n,r) = C(n-1, r-1) + C(n-1, r).
How do I compute combinations with very large n?
Use the symmetry C(n,r) = C(n, n-r) and cancel common factors to keep the numbers small. For C(50,48), use the equivalent C(50,2) = (50 × 49)/2 = 1225, which is far easier than expanding 50! directly. Because 50! has more than 64 digits, cancelling terms before multiplying avoids enormous intermediate values and produces the same exact result.

Discover More Tools

Fresh picks from across our tool library.