Skip to content
1001 Tools
sr
Math & education

Permutation and Combination Calculator

Enter how many items you have (n) and how many you pick (r) to get both the number of permutations and the number of combinations. Permutations count arrangements where order matters; combinations count selections where it does not. Both are computed exactly, even when the answers run to many digits.

Enter how many items you have and how many you pick.

How it works

Permutations, written nPr, count ordered arrangements: nPr = n × (n−1) × … down to (n−r+1), which equals n! ÷ (n−r)!. Choosing 2 letters from A, B, C in order gives 3P2 = 6: AB, BA, AC, CA, BC, CB.

Combinations, written nCr (also "n choose r"), count selections where order is ignored, so nCr = nPr ÷ r!. From the same three letters, 3C2 = 3: {A,B}, {A,C}, {B,C}. Because every combination of r items can be arranged in r! orders, combinations are always nPr divided by r!, and nCr never exceeds nPr. The tool requires whole numbers with 0 ≤ r ≤ n and computes with big integers so results stay exact.

Practical examples

Lottery odds — Loto 7/39

Serbia’s Loto draws 7 numbers from 39, and order does not matter, so the count is 39C7 = 15,380,937 possible tickets — your odds of matching all seven on one ticket.

A three-place podium

With 8 finalists competing for gold, silver and bronze, order matters, so there are 8P3 = 336 possible podiums.

Picking a team

Choosing 5 players from a squad of 12, where the five are just a group, gives 12C5 = 792 possible line-ups.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts arrangements where order matters; a combination counts selections where order does not. Ranking three runners is a permutation; choosing three runners for a relay pool is a combination.

What do nPr and nCr mean?

They are the standard symbols: nPr is the number of permutations of r items chosen from n, and nCr (also written C(n,r) or "n choose r") is the number of combinations. Here n is the total and r is how many you take.

What are the formulas?

nPr = n! ÷ (n−r)! and nCr = n! ÷ (r! × (n−r)!). Equivalently, nCr = nPr ÷ r!, since each unordered selection of r items can be ordered in r! ways.

Why is nCr always smaller than or equal to nPr?

Because permutations distinguish orderings that combinations lump together. Each single combination corresponds to r! permutations, so dividing by r! can only shrink the count (or leave it equal when r is 0 or 1).

What happens when r equals 0 or n?

Choosing 0 items gives exactly one outcome (the empty selection), so nP0 = nC0 = 1. Choosing all n as a set also gives nCn = 1, while nPn = n! because all n can be ordered.

Can r be larger than n?

No. You cannot choose more distinct items than exist, so the tool reports an error when r exceeds n. Both counts would be zero in that case.

Does this allow repetition?

No. This calculates selections without repetition, where each item is used at most once — the usual textbook case. Problems that allow repeats (like combinations with replacement) use different formulas.

How large can n be?

Up to 100,000. The results use big-integer arithmetic, so they are exact rather than rounded, though very large n with mid-range r can produce numbers with thousands of digits.

How does this relate to Pascal’s triangle?

Each entry in Pascal’s triangle is a combination: row n, position r is nCr. So the triangle is just the table of "n choose r" values, and it explains the identity nCr = (n−1)C(r−1) + (n−1)Cr.

Are my inputs private?

Yes. Everything is calculated in your browser; the numbers you enter are never uploaded and never reach analytics.

Related tools