Enter the size of a set and how many items you are picking to get nPr, nCr and both repetition variants at once, with exact answers even when the results run to hundreds of digits.
Permutations and combinations belong to combinatorics, the branch of mathematics that counts possibilities without listing them. How many ways can a race finish? How many hands can a card game deal? How many passwords of a given length exist? Answering by writing every case down is hopeless even for small sets, because the counts explode astonishingly fast. The formulas on this page replace the listing with a few multiplications, and this permutation and combination calculator carries them out for you.
The two central ideas differ in exactly one respect. A permutation counts ordered arrangements: swapping two items produces a different outcome. A combination counts selections: only which items end up chosen matters, never the sequence.
Almost every counting mistake is really a failure to answer this question first, so it is worth rehearsing with two everyday cases.
Notice that P(10, 3) = 720 is exactly 6 times C(10, 3) = 120, and 6 = 3! is the number of ways three chosen items can be ordered. That relationship is no accident: every combination is a bundle of r! permutations that differ only in arrangement, and the combination formula simply divides the permutation count by that redundancy. A combination can therefore never exceed the matching permutation count, and the two are equal only when r is 0 or 1.
Both formulas are built from the factorial, written n!, which is the product of every whole number from 1 to n. It answers a question in its own right: how many ways can n items be arranged in a row? Ten books can be shelved in 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800 different orders.
The growth rate is brutal. Each step multiplies by a larger number still: 10! is about 3.6 million, 20! is about 2.4 × 1018, and 52! already has 68 digits, more than the number of atoms in a grain of sand times itself a billionfold. This is why the calculator computes with exact integer arithmetic rather than floating point: rounded off in an ordinary spreadsheet, 20! or larger silently loses low digits, and a probability computed from it can be visibly wrong.
Two conventions complete the picture: 0! = 1 by definition, and choosing all n items at once has exactly one combination (though the items can still be arranged in n! orders). Both fall out of the formulas naturally, which is why C(n, 0) and C(n, n) equal 1, and P(n, 0) does too.
Each formula below is shown with a worked example you can reproduce in the calculator.
P(n, r) = n! ÷ (n - r)!
How many ordered arrangements of r items can be drawn from n, each item used at most once. Example: P(10, 3) = 10! ÷ 7! = 3,628,800 ÷ 5,040 = 720.
Equivalently, multiply down from n for r steps: 10 × 9 × 8 = 720. The first pick has n candidates, the second n - 1, and so on, because a used item cannot be used again.
C(n, r) = n! ÷ [r! × (n - r)!]
How many unordered selections of r items from n. Example: C(10, 3) = 3,628,800 ÷ (6 × 5,040) = 120. This is also the binomial coefficient, the number in Pascal's triangle and the "choose" operator of the binomial theorem.
nr
How many ordered strings of length r exist when every position independently allows any of the n items. Example: a 3-digit PIN over the digits 0 to 9 has 103 = 1,000 codes; with only 4 allowed digits it would be 43 = 64.
C(n + r - 1, r)
How many multisets of r items from n types, repeats allowed and order ignored. Example: choosing 3 scoops for a cone from 4 flavors gives C(4 + 3 - 1, 3) = C(6, 3) = 20 cones, triple-chocolate fully permitted.
The default case in most homework and most real draws is without repetition: once a card is dealt or a runner is placed, it is out of the pool. Repetition belongs in the formula only when the same item genuinely can appear more than once:
Every combination count lives in Pascal's triangle. Start a 1 at the top; build each row by adding the two numbers above it; and the row beginning 1, n holds the values of C(n, 0) through C(n, n) in order. Row 5 reads 1, 5, 10, 10, 5, 1, which is C(5, 0) = 1, C(5, 1) = 5, C(5, 2) = 10 and so on, exactly what the formula gives.
The triangle remembers two deep facts. First, the symmetry C(n, r) = C(n, n - r): choosing 2 flavors to include is the same count as choosing 3 to leave out, which is why the 10 appears twice in row 5. Second, Pascal's identity, C(n, r) = C(n - 1, r - 1) + C(n - 1, r): every entry is literally the sum of the two above it. Split your choices into "the new item is in" and "the new item is out", and the two branches are those neighbors.
Historically this is where the subject matured. In 1654, Blaise Pascal and Pierre de Fermat exchanged letters about gambling questions posed by the Chevalier de Méré, and in working them out they systematized these counting rules, seeding both combinatorics and probability theory in one correspondence.
Cover the answers, decide order and repetition first, then check yourself against the calculator:
Order is the whole difference. A permutation counts ordered arrangements, so ABC and BAC are two different results; a combination counts unordered selections, so ABC and BAC are the same single result. If the question says arrange, rank or assign to distinct positions, use permutations; if it says choose, select or form a group, use combinations.
Because the sequence you enter must match exactly: 1-2-9 opens the lock and 9-2-1 does not, which is the definition of order mattering. Mathematicians have joked about this misnomer for decades, and it doubles as the fastest memory hook for the distinction between the two concepts.
Each combination bundles together every ordering of the same chosen items, and there are exactly r! of those orderings. Dividing the permutation count by r! removes that redundancy, so C(n, r) = P(n, r) / r!. The division is exact, and the two counts coincide only when r is 0 or 1, because a single item has only one arrangement.
It allows the same item to appear more than once in a single outcome. With repetition and order, each of the r positions independently allows all n items, giving n to the power r. With repetition and no order, the count becomes C(n + r - 1, r). Repetition is correct for PINs, dice rolls, and multi-scoop cones, and wrong for dealt cards or committee seats.
Because there is exactly one way to select nothing: select nothing. The formulas confirm it, since C(n, 0) = n! / (0! × n!) = 1 under the convention 0! = 1. The same logic makes P(n, n) = 1: a full set has a single arrangement relative to itself, and C(n, n) = 1 as well.
They never stop being exact. The calculator uses arbitrary-precision integers, so even 1000! with its 2,568 digits is computed digit for digit. The only display change is cosmetic: results longer than 15 digits drop the thousands separators but remain complete, and nothing is ever rounded or shown in scientific notation.
Distinct arrangements of items with duplicates are counted by the multinomial coefficient: n! divided by the product of the factorials of each identical group's size. The word BANANA, for example, has 6! / (3! × 2! × 1!) = 60 distinct arrangements, because its three A's and two N's are interchangeable. This calculator handles the selection stage; divide by the duplicate factorials afterwards if your items repeat.
It comes from a picture called stars and bars. Counting multisets of r items from n types is the same as laying out r stars for the items and n - 1 bars that divide them into n groups, and every arrangement of those r + n - 1 symbols is one selection. Choosing which r of the positions are stars gives C(n + r - 1, r). For 3 scoops from 4 flavors, that is C(6, 3) = 20.
Use the multiplication principle: when one outcome is a chain of independent choices, multiply the number of options at each step. Three shirts and four pants make 12 outfits, and a plate of 3 letters and 2 digits makes 26 × 26 × 26 × 10 × 10 = 1,757,600. The permutation and combination formulas are this principle refined for the case where every choice draws from the same shrinking (or reusable) pool.
It decomposes one hard count into two easier ones: C(n, r) = C(n - 1, r - 1) + C(n - 1, r), splitting the selections by whether a particular item is included. It is the reason the triangle can be built by simple addition instead of factorials, and it is the engine behind fast exact algorithms for binomial coefficients in software that must avoid enormous intermediate factorials.
No. Every calculation runs in your browser. Nothing is stored or transmitted.