Permutation & Combination Calculator
The only question that matters is whether order counts. If ABC and CBA are different outcomes you want permutations; if they are the same selection you want combinations. Everything else follows from that.
Selection
n is the pool size, r is how many you take.
Order matters, or it does not
A permutation counts arrangements: first, second and third place in a race are three different outcomes depending on who finishes where. P(n, r) = n! / (n − r)!.
A combination counts selections: a committee of three people is the same committee whichever order you list them in. C(n, r) = n! / (r!(n − r)!). The extra r! in the denominator divides out every rearrangement of the same group — which is exactly the ratio the calculator reports.
With repetition, and why the formula looks odd
If an item can be chosen more than once — a four-digit PIN, an ice cream with three scoops from eight flavours — the counts change. Ordered with repetition is simply nr, because every position independently has n choices. Unordered with repetition is C(n + r − 1, r), the "stars and bars" result, and it is the one people almost never guess correctly.
A worked example: the lottery
Choosing 6 numbers from 49 where order does not matter gives C(49, 6) = 13,983,816. That is the odds of a jackpot on one ticket. If order did matter it would be P(49, 6) = 10,068,347,520 — 720 times larger, which is 6!, the number of ways to shuffle any single winning set. Seeing those two numbers side by side is the fastest way to internalise what the r! is doing.
Why this uses exact arithmetic
Factorials grow faster than anything else in elementary maths. 21! already exceeds the largest integer JavaScript can represent exactly, so ordinary floating-point calculators start returning approximations without saying so. This page computes with arbitrary-precision integers and only falls back to scientific notation when a result is genuinely too long to display — the digits it shows are the real ones.
Frequently Asked Questions
What is the difference between a permutation and a combination?
What is 0 factorial?
Why is C(n, r) the same as C(n, n − r)?
Can r be larger than n?
Sources
Official publications only. Links open the original document in a new tab.
- National Institute of Standards and Technology Special Publication 811 — Guide for the use of the SI Significant figures and rounding conventions
- National Institute of Standards and Technology CODATA fundamental physical constants Values of the fundamental physical constants