Free Permutation and Combination Calculator

Compute permutations (nPr) and combinations (nCr) for any two whole numbers, along with the factorials n! and r!, instantly and with the formulas shown.

Enter the total number of items n and how many you take r (whole numbers, n ≥ r ≥ 0). Permutations nPr, combinations nCr and the factorials update instantly.

Results
Permutations nPr (order matters)20
Combinations nCr (order ignored)10
n! (5!)120
r! (2!)2
(n − r)! (3!)6

nPr = n! / (n − r)! counts ordered arrangements; nCr = n! / (r! · (n − r)!) counts unordered selections. Because each group of r items orders in r! ways, nPr = nCr · r!. Note 0! = 1, so nP0 = nC0 = 1 and nCn = 1.

Quick answer

Permutations count ordered arrangements with nPr = n! / (n − r)!, while combinations count unordered selections with nCr = n! / (r! · (n − r)!). For example, choosing 2 from 5 gives 5P2 = 120/6 = 20 ordered pairs but only 5C2 = 120/(2·6) = 10 unordered pairs. Permutations are always ≥ combinations because each unordered group of r items can be ordered in r! ways.

Formula & method

Permutations (order matters)

nPr = n! / (n − r)!
  • n total number of distinct items available
  • r number of items chosen and arranged
  • n! factorial of n, i.e. n·(n−1)·…·2·1 (with 0! = 1)

Number of ways to arrange r items chosen from n distinct items when the order of selection matters. Requires n ≥ r ≥ 0.

Combinations (order does not matter)

nCr = n! / (r! · (n − r)!)

Number of ways to select r items from n distinct items when order is irrelevant. Equals nPr divided by r!. Also written C(n,r) or the binomial coefficient "n choose r".

Relationship between the two

nPr = nCr · r!

Each unordered combination of r items can be arranged in r! different orders, so there are always r! times as many permutations as combinations.

Examples

Example 1: Choose 2 from 5 (the default)
Input
n = 5, r = 2
Result
nPr = 20, nCr = 10, 5! = 120, 2! = 2
Why
5! = 120 and (5−2)! = 3! = 6, so 5P2 = 120 / 6 = 20. For combinations divide by r! = 2! = 2: 5C2 = 120 / (2 · 6) = 120 / 12 = 10. There are 20 ordered pairs but only 10 unordered pairs.
Example 2: Ranking the top 3 of 10 runners
Input
n = 10, r = 3
Result
nPr = 720, nCr = 120
Why
Order matters for a podium (gold/silver/bronze), so 10P3 = 10! / 7! = 10 · 9 · 8 = 720. If you only need which 3 qualify (no order), 10C3 = 720 / 3! = 720 / 6 = 120.
Example 3: A 5-card poker hand from 52 cards
Input
n = 52, r = 5
Result
nCr = 2,598,960
Why
A poker hand is unordered, so use combinations: 52C5 = 52! / (5! · 47!) = (52·51·50·49·48) / (5·4·3·2·1) = 311,875,200 / 120 = 2,598,960 distinct hands.
Example 4: Arranging all 6 items (r = n)
Input
n = 6, r = 6
Result
nPr = 720, nCr = 1
Why
When r = n, (n−r)! = 0! = 1, so 6P6 = 6! / 0! = 720 / 1 = 720 (all orderings of 6 items). There is only one way to choose all of them, so 6C6 = 720 / (720 · 1) = 1.

When to use this tool

  • When you need the number of ordered arrangements (passwords, race rankings, seating orders, license plates) — use the permutation output nPr.
  • When you need the number of unordered selections (lottery tickets, poker hands, committees, pizza toppings) — use the combination output nCr.
  • When studying probability or combinatorics and you want to check homework by seeing both nPr and nCr plus the intermediate factorials side by side.
  • When estimating the size of a sample space to compute a probability such as a lottery's odds (1 in nCr) or the chance of a specific arrangement.

Common mistakes

  • Using permutations when order does not matter. If picking a committee or a hand of cards, order is irrelevant — use nCr, not nPr, or you will overcount by a factor of r!.
  • Forgetting that 0! = 1. When r = 0 or r = n, the term (n − r)! or r! becomes 0!, which equals 1 (not 0); both nP0 and nC0 equal 1, and nCn = 1.
  • Entering r greater than n. You cannot choose more items than are available, so nPr and nCr are undefined (this calculator returns an error) whenever r > n.
  • Using non-integer or negative inputs. Permutations and combinations are only defined for whole numbers with n ≥ r ≥ 0; decimals or negatives are invalid.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts arrangements where order matters, while a combination counts selections where order does not. Picking 1st, 2nd and 3rd place from 10 runners is a permutation (10P3 = 720); picking any 3 finalists is a combination (10C3 = 120). Because each group of r items can be ordered r! ways, nPr is always r! times larger than nCr.

How do I calculate nPr by hand?

Use nPr = n! / (n − r)!. In practice you just multiply the r largest descending factors of n: nPr = n · (n−1) · … · (n−r+1). For example 7P2 = 7 · 6 = 42, and 10P3 = 10 · 9 · 8 = 720. There is no need to compute the full factorials — the (n − r)! in the denominator cancels everything below n−r+1.

Why is nCr smaller than nPr?

Combinations ignore order, so several permutations collapse into one combination. Specifically, each unordered group of r items can be arranged in r! ways, so nCr = nPr / r!. With n = 5, r = 2 there are 20 ordered pairs but only 10 unordered pairs because each pair (like A,B and B,A) is counted once.

What is 0! and why does it equal 1?

By definition 0! = 1. This keeps the formulas consistent: there is exactly one way to arrange zero items (the empty arrangement), and it makes nC0 = 1 and nCn = 1 work out correctly. So nP0 = n!/n! = 1 and nCn = n!/(n!·0!) = 1.

Can n or r be negative or a decimal?

No. Permutations and combinations are only defined for non-negative whole numbers with n ≥ r ≥ 0. Negative values, decimals, or r larger than n have no combinatorial meaning, so this calculator flags them as invalid rather than returning a misleading number.

What are some real-world examples of each?

Permutations: PINs and passwords, race podium finishes, seating arrangements, and ranking choices — anything where the order of the selected items distinguishes one outcome from another. Combinations: lottery number sets, 5-card poker hands, picking a committee, or choosing pizza toppings — where only which items are chosen matters, not their order.

Sources & references

External references open in a new tab. We are independent and not affiliated with these organizations.

  • ✓ Free to use
  • ✓ No sign-up required
  • Runs entirely in your browser — nothing is uploaded.
  • ✓ Formula and method shown above

Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.

Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.

Related tools

Embed this tool on your site

Free to embed, no sign-up. Paste this code where you want the permutation and combination calculator to appear: