Permutation Calculator
Arrangements, counted honestly
A permutation is an arrangement in which order carries meaning: the podium, the password, the running order. Counting them is a multiplication with a story — the first position can be filled n ways, the next n−1 (one item is spent), and so on down r positions, giving the falling product n!/(n−r)!. This calculator evaluates that product in exact big-integer arithmetic, so the answer is never a floating-point shrug: P(52,5) comes out as 311,875,200 because it is, not approximately. Beside the permutation count it always shows the matching combination count, because the pair of numbers together teach the one idea students actually need: the factor between them is r!, the number of ways the same selection can be ordered.
The repetition switch changes the universe. Forbid reuse and the choices deplete as you pick; allow it — PINs, licence plates, dice rolls, DNA codons — and every position offers all n options again, giving n^r. Real problems announce which world they live in if you ask one question: can the same item appear twice in a valid outcome? A committee cannot contain the same person twice; a safe code not only can repeat a digit, it usually does.
How the calculation works
Without repetition: nPr = n! ÷ (n−r)!, computed as the product n × (n−1) × … × (n−r+1). With repetition: n^r. Combinations for comparison: nCr = nPr ÷ r!. Edge cases follow the standard conventions: r = 0 gives exactly 1 (the empty arrangement), r = n without repetition gives n!, and r > n without repetition gives 0 — you cannot fill more distinct positions than you have items, though with repetition you can fill any number.
Worked examples
The podium: P(10, 3) = 720 ordered medal outcomes from 10 finalists; the same finalists form only 120 unordered medal sets.
The dealt hand: P(52, 5) = 311,875,200 ordered deals; C(52, 5) = 2,598,960 actual poker hands.
The PIN: no-repeat 4-digit codes would number P(10, 4) = 5,040; real PINs allow repetition, giving 10,000 — repetition nearly doubles the space.
The full shuffle: 20! = 2,432,902,008,176,640,000 arrangements of just 20 items — factorial growth outruns intuition almost immediately.
Partial permutations of people and things
Most real permutation problems are partial — r much smaller than n — and the numbers stay deceptive at exactly that scale. A league of 20 teams can finish in 20! orders, but the ordered top four alone can be arranged P(20,4) = 116,280 ways, which is why exact-score prediction of a top four is a mug's game. A bookshelf shows the domestic version: 8 books chosen from a collection of 30, arranged in a row, is P(30,8) — over 235 billion displays, so the odds that your shelf has ever been duplicated are effectively nil. And security lives here too: the reason a 6-digit code (1,000,000 with repetition) resists casual guessing while a 4-digit one (10,000) does not is pure permutation arithmetic — two more positions multiply the space by a hundred. Whenever a problem smells of rankings, orders, sequences or codes, this falling product is the count underneath it.
Frequently asked questions
How do you calculate permutations?
Multiply the descending count of choices: for r positions chosen from n items without repetition, nPr = n × (n−1) × … down r terms — equivalently n! ÷ (n−r)!. Choosing an ordered top 3 from 10 runners gives 10 × 9 × 8 = 720 permutations. If repetition is allowed — the same item can be picked again, like digits in a code — the count is simply n to the power r: a 4-digit PIN has 10⁴ = 10,000 possibilities.
What is the difference between permutations and combinations?
Order. Permutations count arrangements, where gold-silver-bronze differs from silver-gold-bronze; combinations count selections, where the same three medallists are one outcome regardless of order. Every combination of r items corresponds to r! permutations of it, so combinations are always the smaller number: 5 cards from 52 can be dealt in 311,875,200 orders but form only 2,598,960 distinct hands — the ratio is exactly 5!, or 120.
When does order actually matter in real problems?
Whenever the positions are distinguishable: podium finishes, batting orders, seating plans, passwords and PINs, race results, rankings. It does not matter for committees, lottery numbers (the draw order is irrelevant to the ticket), dealt hands, or ingredients in a recipe. The honest test is one question: if I swap two of the chosen items, do I get a different outcome? If yes, permute; if no, combine.
How many permutations are there of a full deck?
52 factorial — about 8.07 × 10⁶⁷, a number so large that every thoroughly shuffled deck in history has almost certainly been in an order never seen before and never to be repeated. This calculator computes factorials exactly using big-integer arithmetic, so 20! comes out as the full 2,432,902,008,176,640,000 rather than a rounded approximation; beyond a few hundred, it reports scientific notation before the digits become a page of their own.
Why is 0! equal to 1?
Because there is exactly one way to arrange zero items — the empty arrangement — and because the mathematics requires it: the recurrence n! = n × (n−1)! only works down to 1! if 0! = 1, and formulas like nPr with r = n need (n−n)! = 0! = 1 in the denominator to give the right answer, n!. It feels like a convention; it is actually a consistency the whole system depends on.
Related tools
Formulas and worked examples last verified: 24 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.