Permutation Calculator
Calculate permutations (nPr) with exact results and step-by-step working, with or without repetition.
Arrange r different items chosen from n. Each item is used at most once, and order matters.
How many different items you can choose from, e.g. 5 runners.
How many are arranged in order, e.g. 2 medal places.
Permutation result
There are 20 ordered arrangements of 2 items chosen from 5.
All 20 arrangements
Using letters A, B, C, D, E for the 5 items.
- AB
- AC
- AD
- AE
- BA
- BC
- BD
- BE
- CA
- CB
- CD
- CE
- DA
- DB
- DC
- DE
- EA
- EB
- EC
- ED
Order matters: AB and BA are counted as two different arrangements.
How we calculated it
Step 1 — Identify the inputs
n = 5, r = 2
Step 2 — Apply the permutation formula
nPr = n! / (n − r)!
n! (n factorial) is n × (n − 1) × … × 1, and 0! = 1.
Step 3 — Substitute the values
P(5, 2) = 5! / (5 − 2)! = 5! / 3!
Step 4 — Cancel the common factors
= (5 × 4 × 3 × 2 × 1) / (3 × 2 × 1)
Every factor from 3 down to 1 appears in both, so it cancels, leaving the 2 largest factors.
Step 5 — Multiply what remains
= 5 × 4
That is 5 choices for position 1, 4 choices for position 2.
Result
P(5, 2) = 20
If order does not matter, use the Combination Calculator instead: nCr = nPr ÷ r!. Need a single factorial such as 5!? Use the Factorial Calculator. To turn a count of arrangements into a chance, divide the favorable arrangements by the total in the Probability Calculator.
This permutation calculator (nPr calculator) counts the ordered arrangements of r items chosen from n different items. Enter n and r to get the exact answer, the formula filled in with your numbers, and each step of the calculation. A second mode handles permutations with repetition, where an item can be used more than once.
Permutations count order: choosing A then B is a different arrangement from choosing B then A, so AB ≠ BA.
Worked Calculation Examples
| Scenario | Result | Calculation Step |
|---|---|---|
| 5P2: ordering 2 items from 5 | 20 | 5P2 = 5! ÷ 3! = 5 × 4 = 20. |
| 10P3: ranking 1st, 2nd, 3rd from 10 racers | 720 | 10P3 = 10! ÷ 7! = 10 × 9 × 8 = 720. |
| 8P4: filling 4 distinct roles from 8 people | 1,680 | 8P4 = 8! ÷ 4! = 8 × 7 × 6 × 5 = 1,680. |
| 5P5: arranging all 5 books on a shelf | 120 | 5P5 = 5! ÷ 0! = 5! = 5 × 4 × 3 × 2 × 1 = 120. |
| 5³: 3-character codes from 5 symbols, repetition allowed | 125 | Each of the 3 positions can be any of the 5 symbols: 5 × 5 × 5 = 125. |
The Permutation Formula
The number of permutations of r items from n is nPr = n! / (n − r)!, where n! (n factorial) is the product of every whole number from n down to 1, and 0! = 1.
Most of the factorials cancel. For 6P3 = 6! / 3! = (6 × 5 × 4 × 3 × 2 × 1) / (3 × 2 × 1), the 3 × 2 × 1 cancels, leaving 6 × 5 × 4 = 120. That matches the direct reasoning: 6 choices for the first position, 5 for the second, and 4 for the third. Two special cases follow from the formula: nP0 = 1 (one way to arrange nothing) and nPn = n! (every item is arranged).
When to Use a Permutation
Use permutations when you are selecting items and their order matters. Awarding gold, silver, and bronze to 3 of 8 runners is a permutation: Ana gold and Ben silver is a different result from Ben gold and Ana silver, so there are 8P3 = 8 × 7 × 6 = 336 possible podiums.
Other common permutation problems include ranking a shortlist, assigning people to distinct roles (president, secretary, treasurer), seating people in a row, scheduling tasks in order, and counting codes or passwords. If an item can appear more than once, as with the digits of a PIN, use permutations with repetition: n^r. A 4-digit PIN has 10^4 = 10,000 possibilities.
Permutations vs. Combinations
A permutation counts ordered arrangements; a combination counts selections where order does not matter. ABC and BAC are different permutations but the same combination, just as choosing Alice and Bob for a team is the same selection as choosing Bob and Alice.
Permutation: nPr = n! / (n − r)!. Combination: nCr = n! / [r!(n − r)!]. Each combination of r items can be put in order in r! ways, so nCr = nPr ÷ r!. For 5 items taken 2 at a time, 5P2 = 20 but 5C2 = 20 ÷ 2 = 10. Use the Combination Calculator when order does not matter.
How to Use the Permutation Calculator
- Choose Without repetition (nPr) for arrangements of different items, or With repetition (nʳ) when an item can be used more than once.
- Enter the total number of items (n) and the number of items being arranged (r). Both must be whole numbers, and r cannot exceed n without repetition.
- Read the result. Results update as you type, and very large results show a scientific approximation along with the exact value.
- Follow "How we calculated it" to see the formula filled in with your numbers and the factorials cancelled step by step.
- Use Copy result to copy the answer, formula, and inputs, or Reset to start again.
Frequently Asked Questions
What is a permutation?
A permutation is an ordered arrangement of items. Arranging r items chosen from n different items gives nPr permutations; for example, the 2-letter arrangements of A, B, and C are AB, AC, BA, BC, CA, and CB, so 3P2 = 6.
What is the permutation formula?
nPr = n! / (n − r)!, where n is the total number of items, r is the number being arranged, and ! means factorial. For 5P2: 5! / 3! = 5 × 4 = 20.
What does nPr mean?
nPr, also written P(n, r), is the number of permutations of n items taken r at a time: the number of ordered ways to arrange r items chosen from n.
What is the difference between permutations and combinations?
Permutations count arrangements where order matters, and combinations count selections where it does not. From 5 items taken 2 at a time there are 5P2 = 20 permutations but only 5C2 = 10 combinations, because each pair can be ordered 2 ways.
Can r be greater than n in a permutation?
Not without repetition: you cannot arrange more distinct items than you have, so r must be between 0 and n. With repetition allowed, r can be larger than n; for example, a 6-digit code from 2 symbols has 2^6 = 64 possibilities.
Does order matter in permutations?
Yes. Order is what defines a permutation: AB and BA are two different permutations. If order does not matter, count combinations instead.
Can permutations include repetition?
Yes. When each item can be used more than once, the number of ordered arrangements of r positions from n items is n^r. For example, 3-letter strings from 5 letters with repetition number 5^3 = 125.
What is nP0, and what is nPn?
nP0 = 1, because there is exactly one way to arrange no items. nPn = n!, because arranging all n items gives n × (n − 1) × … × 1 arrangements; for example, 5P5 = 5! = 120.
Related Calculators
Combination Calculator
Calculate combinations (nCr), the number of ways to choose r items from n when order does not matter, with exact results and step-by-step working.
Probability Calculator
Calculate simple probability from favorable and total outcomes, as a percentage, decimal, and simplified fraction, with the complement and step-by-step working.
Factorial Calculator
Calculate n! exactly, with the step-by-step multiplication, digit count, trailing zeros and scientific notation.
Percentage Calculator
Calculate percentages, percent of a number, and percentage changes fast.
Scientific Calculator
Advanced math calculator supporting trigonometry, logs, exponentials, and roots.
Percentage Increase Calculator
Calculate the percentage increase or decrease from an old value to a new value, the new value after an increase, or the original value, with steps.
Last updated: September 27, 2026.