
Permutation Calculator
Permutation calculator: find nPr, the number of ordered arrangements of r items chosen from n, as an exact whole number. Learn combinations by hand.
Written by
Annie Button
Updated
There was an error with your calculation.
Permutation
6720
Permutation calculator at a glance#
What is a permutation?#
A permutation is an arrangement of objects in a specific order. Awarding gold, silver, and bronze medals to 3 of 8 runners represents a permutation problem. This is because the same trio of runners, ordered differently, will produce a distinct outcome.
How do you calculate permutations?#
To calculate permutations, use P(n, r) = n! ÷ (n − r)!, also written nPr, where n denotes the total number of objects and r is the quantity you select and arrange. The exclamation mark signifies a factorial. For 8 runners and 3 medals, P(8, 3) = 8! ÷ 5! = 8 × 7 × 6 = 336. Input n and r above, and the calculator will provide the precise count.
What is 5P2?#
5P2, also written P(5, 2) and read as 5 permute 2, is 20. There are 5 options for first place and 4 remaining for second place, resulting in 5 × 4 = 20 ordered pairs.
What a permutation counts#
Order is essential for a permutation. If Ana, Ben, and Cara take first, second, and third places respectively, it's a distinct result from Cara, Ben, and Ana, even with the same three runners on the podium. A permutation counts each of these orders as separate.
The calculation is based on filling one position at a time. Any of the 8 runners can secure gold. With gold awarded, 7 runners remain for silver, then 6 for bronze. By multiplying these choices, 8 × 7 × 6 = 336, you obtain every potential podium. OpenStax Precalculus refers to this as the multiplication principle, which forms the foundation of the permutation formula.
The formula relies on factorials. A factorial, denoted as n!, involves multiplying every whole number from n down to 1, so 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1, which ensures the formula's validity when arranging all objects.
How to calculate a permutation by hand#
You can reach the same result using two different methods.
- With the formula: 8! = 40,320 and 5! = 120, so P(8, 3) = 40,320 ÷ 120 = 336.
- With the shortcut: start with n and multiply r numbers, counting down. For P(8, 3), this involves three numbers, 8 × 7 × 6 = 336.
The shortcut bypasses large factorials that cancel out. In a spelling bee with 22 contestants, the number of ways to finish the top 5 positions is 22 × 21 × 20 × 19 × 18 = 3,160,080. The diagram below illustrates the medals example, showing one slot per position, with choices decreasing by one each time.

Some special scenarios often occur:
- Arranging all n objects: when r equals n, the answer is n!. For instance, six books on a shelf can be arranged in P(6, 6) = 720 ways.
- Choosing none: when r is 0, the answer is 1, since there's only one way to arrange nothing.
- Choosing one: when r is 1, the answer is n itself.
- Choosing more than available: when r exceeds n, no arrangement is possible, and the calculator shows an error.
What the calculator accepts#
Input n as a whole number of 0 or more, and r as a whole number not exceeding n. The calculator handles exact whole numbers, not rounded decimals, so P(52, 52), the number of ways to organize a complete deck of cards, is displayed with all 68 digits. Results up to 500 digits are shown in full. Beyond that, the answer is given in e notation, so P(254, 254) ends in e+502, which means times 10 to the power 502. The scientific notation calculator explains how to interpret this format.
Permutations vs combinations#
A combination is a selection where order doesn't matter. Choosing which 3 of the 8 runners advance to a final is a combination, because the group is the same regardless of which runner is named first. There are fewer combinations than permutations, since every group of 3 can be arranged in 3! = 6 ways.
Every combination of three runners appears 6 times among the 336 podiums. Dividing removes the repeats and gives: C(8, 3) = 336 ÷ 6 = 56. In general, this is represented by C(n, r) = P(n, r) ÷ r!, which OpenStax writes as C(n, r) = n! ÷ (r! × (n − r)!).

The calculator above returns permutations only. For a combination, take its answer and divide by the factorial of r.
A quick test helps decide which one you need. Swap two of the chosen items. If the swap gives a different outcome, as it does for a podium, a password, or a seating plan, you should count permutations. If it doesn't, as is the case for a committee, a hand of cards, or a pizza topping choice, count combinations. Five cards dealt from a 52-card deck make P(52, 5) = 311,875,200 ordered deals but only C(52, 5) = 2,598,960 different hands.
Permutations with repetition#
The calculator handles arrangements where no item repeats, using each object at most once. When repetition is allowed, every position has all n choices, so the count becomes n raised to the power of r. For a code with 4 digits, each ranging from 0 to 9, there are 104 = 10,000 possible codes. If digits cannot repeat, the count falls to P(10, 4) = 10 × 9 × 8 × 7 = 5,040, which is what the calculator will provide.
When dealing with repeated identical objects, a different approach is needed. For example, the letters in the word BANANA have 6! = 720 possible arrangements if each letter is considered unique. However, swapping two identical A's doesn't create a new arrangement. To find the distinct arrangements, divide by the factorial of each repeated count: 720 ÷ (3! × 2! × 1!) = 720 ÷ 12 = 60 unique orders. OpenStax gives the same rule for permutations of objects that aren't all unique.
Permutations on a handheld calculator#
Many scientific and graphing calculators come with an nPr function, usually found under a probability menu or as the second function of a button. To use it, type n, press nPr, then type r and hit equals. For values 8 and 3, the calculator will show 336, which aligns with the result from the example above.
Where permutations are used#
- Rankings and race results include podium places, tournament standings, and the order of finishers.
- Electing officers is another example, with OpenStax noting 120 ways to appoint a president, vice president, and treasurer from 6 members: P(6, 3).
- Permutations are also involved in seating arrangements and scheduling, like the order of people in a line or tasks in a day.
- For codes and passwords, when repetition is possible, the formula is n to the power r, and without repetition, it's P(n, r).
- In probability, dividing favorable arrangements by all arrangements gives a chance, which the probability calculator can combine with other events. The odds calculator can simplify favorable to unfavorable counts into odds.
Common permutation values#
The table provides common values people often reference, alongside the corresponding combination for context. Each permutation is calculated as the combination times r factorial.
| Npr | Also Written | Permutations | Combinations |
|---|---|---|---|
| 3P2 | P(3, 2) | 6 | 3 |
| 5P2 | P(5, 2) | 20 | 10 |
| 6P2 | P(6, 2) | 30 | 15 |
| 6P3 | P(6, 3) | 120 | 20 |
| 7P3 | P(7, 3) | 210 | 35 |
| 8P3 | P(8, 3) | 336 | 56 |
| 8P5 | P(8, 5) | 6,720 | 56 |
| 9P4 | P(9, 4) | 3,024 | 126 |
| 10P3 | P(10, 3) | 720 | 120 |
| 10P4 | P(10, 4) | 5,040 | 210 |
| 20P3 | P(20, 3) | 6,840 | 1,140 |
| 20P5 | P(20, 5) | 1,860,480 | 15,504 |
| 22P5 | P(22, 5) | 3,160,080 | 26,334 |
| 52P5 | P(52, 5) | 311,875,200 | 2,598,960 |
| 6P0 | P(6, 0) | 1 | 1 |
| 6P6 | P(6, 6) | 720 | 1 |
Sources#
Frequently asked questions#
What does nPr mean?#
It's shorthand for the number of permutations of n objects taken r at a time, the same value as P(n, r). The letter n represents the size of the set, r is how many you arrange, and P stands for permutation.
Can r be larger than n?#
No, you can't arrange more objects than you have. There are no permutations when r exceeds n, and the calculator requires an r no larger than n.
Why is 0! equal to 1?#
There's exactly one way to arrange nothing, which is to leave it empty. Setting 0! = 1 keeps the formula correct when r equals n, since P(n, n) = n! ÷ 0! = n!.
How many ways can 5 people sit in a row?#
There are 5! = 5 × 4 × 3 × 2 × 1 = 120 ways. Enter 5 for n and 5 for r. If only 3 of the 5 people get chairs, the count is P(5, 3) = 5 × 4 × 3 = 60.
Is a combination lock a permutation?#
Yes, despite the name. The order of the numbers matters, and the same number can be used twice, so it's a permutation with repetition. A lock with 3 dials of 10 digits has 103 = 1,000 codes.
How do you count the arrangements of the letters in a word?#
If every letter is different, use n! for n letters. For example, the word MATH has 4! = 24 arrangements. If letters repeat, divide by the factorial of each repeat count, as in the BANANA example above.