Permutation Calculator
Calculate permutations for n and r, including nPr style counts. Useful for probability, arranging items, and counting problems.
Enter the Details
Result will appear here...
What this calculator does
You want to arrange some things in order, and the order is the whole point. In how many ways can 5 runners finish first, second and third? How many 4-letter codes can you make from 10 different letters with no repeats? That is a permutation, and this counts them.
Tell it the total number of items and how many you are arranging, and it gives you the count, showing the working as it goes. It runs right here in the browser.
Using the calculator
- Enter the total number of items (n), the set you are arranging from.
- Enter the number of items chosen (k), how many go into the arrangement.
- Press Calculate.
It shows the calculation, n! ÷ (n − k)!, and the result. As with any pick, n has to be at least as big as k. Reset clears both boxes.
What a permutation is
A permutation is an arrangement where order matters. Anna then Ben then Chan is a different permutation from Chan then Ben then Anna, even though it is the same three people, because they are sitting in different positions.
It is usually written nPk or P(n, k): out of n items, arrange k of them in order, and count how many distinct arrangements there are. Anywhere the positions are different, first place versus third, the first letter of a code versus the last, you are dealing with permutations.
The formula, and what each part means
The number of permutations is:
P(n, k) = n! ÷ (n − k)!
where n is the total number of items, k is how many you are arranging, and the exclamation mark is a factorial, a whole number multiplied down to 1, so 5! = 5 × 4 × 3 × 2 × 1 = 120. Dividing n! by (n − k)! neatly cancels everything except the first k factors, which are exactly the choices you make as you fill the k positions.
Permutation vs combination: the one difference
Permutations and combinations answer nearly the same question, split by one word: order.
If the positions matter, it is a permutation. If you only care which items are in the group and not how they are arranged, it is a combination. A gold, silver and bronze finish is a permutation; a three-person committee is a combination.
Because a permutation counts every reordering separately, it is always the bigger number. Choosing 3 from 5 gives 60 permutations but only 10 combinations, and the gap between them, a factor of 6, is exactly 3! (the number of ways to order any 3 chosen items).
A worked example
The podium. Five runners are in a race. In how many ways can the gold, silver and bronze medals be handed out?
Order matters here, because gold and bronze are not interchangeable, so this is a permutation of 3 from 5.
P(5, 3) = 5! ÷ (5 − 3)! = 120 ÷ 2! = 120 ÷ 2 = 60. You can see the same answer by counting the choices directly: 5 runners could take gold, then any of the remaining 4 take silver, then any of the remaining 3 take bronze, and 5 × 4 × 3 = 60.
Where the formula comes from
Think of filling the positions one at a time. For the first spot you have n choices. Having used one, you have n − 1 left for the second spot, then n − 2 for the third, and so on for k positions. Multiply those together and you get n × (n − 1) × ... down through k terms. Writing that as a ratio of factorials, n! ÷ (n − k)!, is just a tidy way to say "the first k factors of n!", which is why the formula looks the way it does.
Two cases worth knowing
Arranging everything. If you arrange all n items, k equals n, and the formula becomes n! ÷ 0!. Since 0! is defined as 1, that is simply n!. So the number of ways to order a whole set of n things is n!: five books on a shelf can be arranged in 5! = 120 orders.
Arranging one, or none. Picking and placing a single item, P(n, 1), is just n. And there is exactly one arrangement of nothing, so P(n, 0) = 1.
A note on large numbers
The tool computes the answer straight from the factorials, which is exact and instant for ordinary values. Bear in mind that factorials balloon very quickly, so past roughly n = 18 the numbers grow beyond the range a browser holds perfectly exact, and for very large n the final digits of the result may not be reliable. For everyday problems it is exact; for enormous n, read a huge result as very close rather than exact to the last digit.
Questions people ask
Does order matter in a permutation?
Yes, that is what defines it. Rearranging the same items gives a different permutation. If order does not matter, you want a combination.
What is the difference between nPr and nCr?
nPr counts ordered arrangements; nCr counts unordered selections. nPr is larger, by a factor of r!, because it treats every reordering as distinct.
How many ways can I arrange all of my items?
That is n!, the factorial of the total. For example, 5 items can be arranged in 5 × 4 × 3 × 2 × 1 = 120 ways.
Does this allow repeats?
No. This counts arrangements with no item used more than once. Each of the k positions is filled by a different item from the set.
Where are permutations used?
Anywhere order counts: race and contest rankings, passwords and codes, seating orders, and scheduling.
References
A note on where this comes from. The count of ordered arrangements of k items chosen from n is a foundational result in combinatorics, standing alongside the combination as its order-sensitive counterpart, and set out in references such as Wolfram MathWorld and the classic text Concrete Mathematics. For further reading, see Permutation.
- Weisstein, Eric W. "Permutation", Wolfram MathWorld, on ordered arrangements and the formula n! / (n − k)!.
- Graham, Knuth and Patashnik, Concrete Mathematics, on permutations and ordered counting.
Okan Atalay is a results driven senior operations manager and a graduate of Industrial Engineering from Bilkent University. With over 22 years of experience in textile manufacturing and integrated operations, he has led large scale business process improvements and strategic planning initiatives. Currently, he serves as a top mathematics expert for a global ed tech platform, where he applies his analytical expertise to solve complex mathematical problems. At Eon Tools, he reviews converter and maths tools.
Other Tools
- Absolute Value Equation Calculator
- Binomial Coefficient Calculator
- Combination Calculator
- Complementary Error Function Calculator
- Completing The Square Calculator
- Complex Number Calculator
- Discriminant Calculator
- Elimination Method Calculator
- Error Function Calculator
- Foil Calculator
- Gamma Function Calculator
- Interval Notation Calculator
- Polynomial Division Calculator
- Quadratic Formula Calculator
- System Of Equations Calculator