UnitConv

Permutation & Combination Calculator

Calculate nPr and nCr exactly with step-by-step working

The total number of items to choose from.

How many items you select (0 ≤ r ≤ n).

Permutations
5P2
20
Order matters (nPr)
Combinations
5C2
10
Order does not matter (nCr)

Step-by-step

5P2
= 5! ÷ (52)!
= 120 ÷ 6
= 20
5C2
= 5! ÷ (2! × (52)!)
= 120 ÷ (2 × 6)
= 10
5!
120
2!
2
(52)!
6

Formulas

nPr = n! ÷ (n − r)!
nCr = n! ÷ (r! × (n − r)!)

Permutations count ordered arrangements; combinations count unordered selections. They use the same factorials but combinations divide by r! to remove duplicate orderings.

What are permutations and combinations?

Permutations and combinations are the two core ideas of counting. A permutation counts how many ways you can arrange r items chosen from a set of n when the order matters — first, second and third place in a race, or the order of letters in a code. A combination counts how many ways you can choose r items from n when the order does not matter — picking a committee, a hand of cards or a set of lottery numbers. Because order is ignored, every combination corresponds to r! different permutations, which is exactly why nCr = nPr ÷ r!. These counts power probability, statistics, the binomial theorem and countless real-world problems, from password strength to genetics.

How to use it

Enter n, the total number of items to choose from, and r, the number you are choosing (with 0 ≤ r ≤ n). The calculator instantly shows the number of permutations (nPr) and combinations (nCr), the factorials n!, r! and (n − r)! used along the way, and the full step-by-step substitution so you can check the work. Expand 'with repetition' to also see n^r and C(n+r−1, r) for problems where items can be reused. All results are exact, even for large n.

The formulas

Permutations (order matters): nPr = n! ÷ (n − r)!. Combinations (order does not matter): nCr = n! ÷ (r! × (n − r)!). For example 5P2 = 5! ÷ 3! = 120 ÷ 6 = 20, while 5C2 = 5! ÷ (2! × 3!) = 120 ÷ 12 = 10. With repetition allowed, permutations are n^r and combinations are C(n+r−1, r). A key property is symmetry: nCr = nC(n − r), so 20C10 = 184756 and 52C5 = 2598960.

Reading the result

nPr tells you how many distinct ordered arrangements exist; nCr tells you how many distinct unordered groups exist. Since nCr = nPr ÷ r!, the combination count is always smaller (or equal when r is 0 or 1). Factorials grow extremely fast — 20! already has 19 digits — so for large inputs the result is shown as an exact integer with a compact scientific approximation. If you see an error, check that both n and r are whole numbers and that r is no larger than n.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts arrangements where order matters (ABC ≠ CBA); a combination counts selections where order does not matter (ABC = CBA). nPr is therefore always at least as large as nCr.

How do I calculate nPr and nCr?

Use nPr = n! ÷ (n − r)! and nCr = n! ÷ (r! × (n − r)!). For instance 10P3 = 720 and 10C3 = 120.

Why is 0! equal to 1?

There is exactly one way to arrange nothing, so 0! = 1 by definition. This keeps identities like nC0 = 1 and nCn = 1 consistent.

Can this handle very large numbers?

Yes. The calculator uses big-integer arithmetic, so factorials and counts beyond 20! are computed exactly, with a scientific approximation shown for readability.