Calculator Tabs

Permutation and Combination Calculator

Permutations and combinations both count the number of ways to choose r items from a set of n, but they answer fundamentally different questions: permutations count arrangements where order matters, combinations count selections where it doesn’t. Choosing a 3-digit PIN from 10 digits is a permutation problem — 123 and 321 are different codes. Choosing 3 lottery numbers from 49 is a combination problem — the same three numbers win regardless of the order you picked them. This calculator computes both at once from the same two inputs, so you never have to guess which formula applies before you see the numbers.

How the Permutation and Combination Calculator Works

Enter n (the total number of items available) and r (how many you’re choosing), and the calculator returns four related values: permutations P(n,r), combinations C(n,r), permutations with repetition allowed, and n factorial. The relationship between the first two is direct — combinations are always permutations divided by r factorial, because for every unique selection of r items, there are exactly r! different ways to arrange them in order. That’s why C(n,r) is always smaller than or equal to P(n,r): combinations are permutations with the “order” information stripped back out.

The Core Formulas

  • Permutations (order matters, no repetition): P(n,r) = n! / (n − r)!
  • Combinations (order doesn’t matter, no repetition): C(n,r) = n! / (r! × (n − r)!)
  • Permutations with repetition allowed: nʳ — used when the same item can be selected more than once, like digits in a PIN code where repeats are allowed.

All three formulas are built from factorials, which is why n! is included directly in the result — it’s the shared building block behind every calculation this tool performs.

The One Question That Decides Which Formula You Need

Before touching either formula, ask: if I rearranged my selection, would it count as a different outcome? If yes, you need a permutation. If no, you need a combination. A few concrete examples:

  • Permutation: Assigning 1st, 2nd, and 3rd place medals to 3 of 10 runners — swapping who gets gold versus bronze creates a genuinely different result.
  • Combination: Selecting a 3-person committee from 10 candidates — the group {Alice, Bob, Carol} is the same committee no matter what order you picked them in.
  • Permutation with repetition: A 4-digit passcode using digits 0-9, where each digit can repeat — there are 10⁴ possible codes, since each of the 4 positions independently has 10 options.

Where This Connects to Probability

Permutations and combinations are the counting foundation underneath most classical probability problems — before you can calculate the probability of an event, you often need to count how many total outcomes are possible and how many of those outcomes count as a “success.” A combination lock’s actual odds, a poker hand’s likelihood, or the chance of winning a lottery all start with exactly the counting this calculator performs, then divide favorable outcomes by total outcomes. Once you have those counts, the Probability Calculator handles the next step — combining event probabilities using union, intersection, and complement rules.

Factorials: The Building Block Behind Every Result Here

n! (read “n factorial”) means multiplying every whole number from n down to 1 — for example, 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorials grow extremely fast: 10! is already over 3.6 million, and 20! exceeds 2 quintillion, which is why permutation and combination results can become enormous even for modest-looking values of n and r. If you want to explore factorials on their own, outside the context of permutations, the Scientific Calculator includes a dedicated factorial function for direct calculation.

Random Selection: A Related but Different Problem

Permutations and combinations count how many ways a selection could happen — they don’t perform the selection itself. If you actually need to draw random numbers, whether for a lottery simulation, a randomized experiment, or picking a random sample from a list, that’s a distinct task handled by the Random Number Generator, which can draw with or without repetition across any range you specify.

From Counting to Statistical Sampling

Combinations specifically underlie a lot of statistical sampling theory — the number of possible samples of a given size from a population is a direct combination calculation. If your actual goal is determining how large a sample needs to be for a survey or study to reach a target level of confidence (a very different question from counting all possible samples), the Sample Size Calculator handles that planning step using margin of error and confidence level rather than raw combinatorics.

Probability Distributions Built on These Same Counts

Many probability distributions taught alongside permutations and combinations — particularly the binomial distribution, which models the number of successes across repeated independent trials — use combinations directly inside their formula to count how many ways a specific number of successes could occur. If you’re working with z-scores, normal distributions, or converting a raw statistical result into a probability or percentile, the Z-Score Calculator handles that separate but related corner of statistics.

Games, Passwords, and Everyday Combinatorics

Outside formal math, this same counting logic shows up in surprisingly ordinary places: how many possible 5-card poker hands exist (a combination, since a hand’s value doesn’t depend on the order cards were dealt), how many unique passwords are possible given a character set and length (permutations with repetition, since characters can repeat and order matters), or how many different starting lineups a coach could field from a roster (a straightforward combination). If you’re specifically evaluating password strength rather than just counting possibilities, the Password Generator reports the actual entropy (in bits) of a generated password, which is a related but more security-focused way of expressing the same “how many possibilities exist” question.

Frequently Asked Questions

What is the difference between a permutation and a combination?

A permutation counts arrangements where order matters — rearranging the same items produces a different result. A combination counts selections where order doesn’t matter — the same group of items is considered one outcome regardless of the order they were chosen in.

How do you know whether to use nPr or nCr?

Ask whether rearranging your selected items would count as a different outcome. If yes, use permutations (nPr). If the same items in any order count as identical, use combinations (nCr).

Why is nCr always smaller than or equal to nPr?

Because nCr is calculated by taking nPr and dividing out all the different orderings of the same r items (r! of them). Since dividing by a number greater than or equal to 1 never increases a value, combinations can never exceed permutations for the same n and r.

What does “permutations with repetition” mean?

It means the same item can be selected more than once in a single arrangement — like digits repeating in a PIN code. The formula for this case is simply nʳ, since each of the r positions independently has n choices available, regardless of what was chosen in the other positions.

Why do factorials grow so quickly?

Because each additional term multiplies the running total by a larger number than the last — 5! multiplies by 5, but 10! multiplies that same chain further by 6, 7, 8, 9, and 10. This compounding growth is why even moderately sized permutation and combination problems can produce results in the millions or billions.