Skip to content

Combination and Permutation Calculator

Calculate nCr and nPr with step-by-step factorial breakdowns. Understand when order matters.

Combination and Permutation Calculator tool

Loading...

Example

Input: n = 52 cards, r = 5 (five-card poker hands)

Result: 52C5 = 2,598,960 combinations; 52P5 = 311,875,200 permutations

52P5 = 52 x 51 x 50 x 49 x 48 = 311,875,200 ordered hands; dividing by 5! = 120 removes the order: 311,875,200 / 120 = 2,598,960.

Common Combinations and Permutations

Situationn and rCombinations (nCr)Permutations (nPr)
Pick 2 of 5 peoplen = 5, r = 21020
Top 3 of 10 runnersn = 10, r = 3120720
Two-card handsn = 52, r = 21,3262,652
Five-card poker handsn = 52, r = 52,598,960311,875,200
6 of 49 lotteryn = 49, r = 613,983,81610,068,347,520
5 of 69 (Powerball white balls)n = 69, r = 511,238,5131,348,621,560
3-letter codes, no repeatsn = 26, r = 32,60015,600

Exact values from this calculator. Use combinations when order does not matter.

  1. Enter the total number of items (n) in the set you are choosing from.
  2. Enter the number of items (r) you are selecting or arranging.
  3. See permutations (order matters) and combinations (order does not matter) calculated together, plus both counts with repetition allowed.
  4. Review the results along with the step-by-step factorial expansion and cancellation for nPr and nCr.
  5. Compare the nCr and nPr values side by side to understand the impact of ordering on the count.

When Order Matters: nCr vs nPr

A combination counts how many ways you can choose r items from n when order does not matter. A permutation counts the ways when order does matter. Choosing 3 people from 10 gives 120 combinations but 720 permutations, because each group of 3 can be lined up in 6 orders. Enter n and r, and this calculator gives both, with the factorial steps written out.

The key question is whether swapping two picks makes a different result. Picking a committee, a hand of cards or lottery numbers is a combination, since the same members in another order are the same group. Awarding gold, silver and bronze is a permutation, since the order changes the outcome. That is why lottery odds use combinations. A 6-from-49 draw has 13,983,816 possible tickets.

The calculator also covers choices where repeats are allowed. Permutations with repetition are n^r. A 4-digit PIN has 10^4 = 10,000 possibilities, because each digit can be anything. Combinations with repetition count selections like 3 scoops of ice cream from 5 flavors, where you may pick a flavor twice. There are 35 such choices.

The step lines show how each answer is built. For 10P3 the tool multiplies 10 x 9 x 8 = 720. For 10C3 it divides that by 3!, which is 6, to get 120. The math is exact for any n up to 170. Answers longer than 20 digits are shown in scientific form with their digit count, since 170! alone has 307 digits. If r is larger than n, the plain versions are undefined, but the versions with repetition still work.

To turn a count into a chance, such as 1 in 13,983,816, use the Probability Calculator.

Formula / How It Works

nPr = n! / (n - r)! | nCr = n! / (r! x (n - r)!) | n! = n x (n-1) x (n-2) x ... x 1

Sources

Frequently Asked Questions

In a permutation the order matters, so ABC and BAC count as different. In a combination the order does not matter, so they count once. Use permutations for rankings, seating plans and codes. Use combinations for teams, card hands and lottery picks.
nCr = n! / (r! x (n - r)!). For choosing 3 from 10: 10! / (3! x 7!) = 120. Dividing by r! removes the different orderings of the same group. A quicker way by hand is to multiply r numbers counting down from n, then divide by r!: (10 x 9 x 8) / 6 = 120.
nPr = n! / (n - r)!, which is the same as multiplying r numbers counting down from n. For the top 3 of 10 runners: 10 x 9 x 8 = 720. Each position has one fewer choice than the one before, because a runner cannot finish twice.
A factorial, n!, multiplies all whole numbers from 1 to n, so 5! = 120. By definition 0! = 1, which keeps the formulas working. For example, 5C5 = 5! / (5! x 0!) should be 1, since there is only one way to choose everything. Factorials grow fast: 20! is over 2.4 quintillion.
Count the combinations, since the order of the numbers does not matter. For 6 numbers from 49, 49C6 = 13,983,816, so one ticket has a 1 in 13,983,816 chance of the jackpot. Games that add a bonus ball from a separate pool multiply this by the size of that pool.

Related Tools

Probability Calculator

Calculate basic, conditional, and Bayesian probability with odds, an independence check, and a Bayes breakdown.

Statistics and Data

Normal Distribution Calculator

Calculate z-scores, percentiles, and probabilities with a bell curve that shades the area below your value.

Statistics and Data

Random Number Generator

Generate random numbers within a range with options for count, uniqueness, and sorting.

Math and Numbers

Percentage Calculator

Calculate percentages, percentage change, difference, increase, and decrease instantly.

Math and Numbers

Standard Deviation Calculator

Calculate mean, variance, and standard deviation for both population and sample data sets instantly.

Statistics and Data

Final Grade Calculator

Determine what grade you need on the final exam to achieve your target course grade based on current standing.

Education and Academic