A permutation is an arrangement in which order matters. Gold, silver and bronze in a race; a president, vice president and treasurer; the first three digits of a code with no repeated digit — each is an ordered selection of r items from n distinct items. Their number is written P(n, r), nPr or ₙPᵣ. This calculator returns it exactly, shows how the factorials cancel, and can list the arrangements themselves for small cases.
How to use the permutations calculator
- Enter Total items (n), the number of different items available.
- Enter Items arranged (r), the number of ordered positions to fill. Without repeats, r cannot exceed n.
- Read P(n, r) on the tape. You also get the unordered count C(n, r), the r! orderings of each group, and nʳ for comparison.
- Tick List the permutations to print them, with items labeled A, B, C… (up to 500, for n ≤ 100 and r ≤ 10).
When n is 25 or less, a table lists P(n, k) and C(n, k) for every k from 0 to n.
Permutations formula (nPr)
The second form is the one to use by hand. The first position can be filled n ways, the second n − 1 ways (one item is used up), and so on for r positions. That product of r falling factors is also called the falling factorial. Two special cases are worth remembering: P(n, n) = n! and P(n, 1) = n.
Permutations and combinations are tied together by one identity:
First choose the group, then order it.
Worked example: medals in an 8-runner final
Eight runners compete for gold, silver and bronze. Order matters — finishing first is not the same as finishing third — so n = 8 and r = 3.
P(8, 3) = 8! ÷ 5!
Cancel 5!: 8 × 7 × 6
= 336 possible podiums
Check with combinations: the medal winners can be chosen C(8, 3) = 56 ways, and each trio can stand on the podium in 3! = 6 orders, giving 56 × 6 = 336.
With the default inputs, a club with 10 members can fill president, vice president and secretary in P(10, 3) = 10 × 9 × 8 = 720 ways, even though only 120 different trios are possible.
Quick reference
| n | P(n, 1) | P(n, 2) | P(n, 3) | P(n, 4) | P(n, n) = n! |
|---|---|---|---|---|---|
| 4 | 4 | 12 | 24 | 24 | 24 |
| 5 | 5 | 20 | 60 | 120 | 120 |
| 6 | 6 | 30 | 120 | 360 | 720 |
| 8 | 8 | 56 | 336 | 1,680 | 40,320 |
| 10 | 10 | 90 | 720 | 5,040 | 3,628,800 |
Notice that P(n, n − 1) = P(n, n): once n − 1 items are placed, the last position has only one choice left.
Choosing the right kind of permutation
Plain nPr assumes distinct items, no reuse and positions in a line. Change any of those and the formula changes too:
- Items can be reused (PINs, license plates): the count is nʳ. See the permutations with replacement calculator, which also handles words with repeated letters.
- Positions form a circle (round tables, necklaces): rotations are not new arrangements, so divide by r. See the circular permutations calculator.
- Order does not matter (committees, hands of cards): divide by r! to get combinations.
How fast permutations grow
Permutations grow faster than any power. Arranging a 52-card deck gives 52! ≈ 8.07 × 10⁶⁷ orders, far more than the number of shuffles ever performed, so a well-shuffled deck is almost certainly in an order no one has seen before. The calculator keeps every digit of results up to 50,000 digits long, and the factorial calculator goes deeper into n! itself. If you are studying permutations as objects rather than counts — their cycles and their sign — the even permutations calculator checks the parity of any permutation you type.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts ordered arrangements and nCr counts unordered groups. Every group of r items can be ordered r! ways, so nPr = nCr × r!. For 10 items taken 3 at a time, P = 720 and C = 120, and 720 = 120 × 6.
What is P(n, n)?
Arranging all n items gives P(n, n) = n! ÷ 0! = n!. Eight books on a shelf can be ordered 8! = 40,320 ways.
Can r be larger than n?
Not without repeats: you cannot fill more positions than you have distinct items, so the calculator stops with a message. If items can be reused, the count is nʳ — use the permutations with replacement calculator.
What if some items are identical?
Then swapping identical items does not create a new arrangement, and you must divide by the factorial of each repeat count. The word BANANA has 6!/(3! × 2!) = 60 distinct arrangements, not 720.
Why is P(n, 0) equal to 1?
There is exactly one way to arrange no items — the empty arrangement — and the formula gives n! ÷ n! = 1.