What this calculator does
Find out how many different ways you can line things up when the order matters. Each such arrangement is called a permutation. Gold, silver and bronze finishers in a race, the digits of a PIN code and a team's batting order are all permutations. Swap two positions, and you get a different outcome. Counting them tells you how many different orders are possible. That's the starting point for many questions about chances and security.
The calculator counts arrangements of r items taken from n items. It works without repetition, where each item is used at most once, written nPr or P(n, r). It also works with repetition, where items can be reused, as with digits in a code. It does the math with exact whole numbers. So even huge results such as 52! are right to every digit.
Where it's used
Why this math matters outside the classroom:
- Race podiums. With 8 runners, gold, silver and bronze can go to P(8, 3) = 8 × 7 × 6 = 336 different ordered trios.
- PIN codes. A 4-digit PIN has 10⁴ = 10,000 possibilities with repeats allowed and 10 × 9 × 8 × 7 = 5,040 without.
- Club officers. A club of 15 can fill president, vice president and treasurer in 15 × 14 × 13 = 2,730 ways.
- Batting orders. A coach can arrange 9 players into a batting order in 9! = 362,880 ways.
- License plates. A plate of 3 letters then 3 digits, repeats allowed, has 26³ × 10³ = 17,576,000 possible arrangements.
Grade level and standards: Grades 11–12; Common Core State Standards for Mathematics HSS.CP.B.9. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Choose Without repetition if each item can fill only one position. Choose With repetition if the same item can appear in several positions.
- Enter n, the number of different items available.
- Enter r, the number of positions to fill.
- Read the count and the working. Large answers appear in scientific notation, with the exact digits listed underneath.
What the inputs mean
- Repetition
- Without repetition fits awarding places to different people. With repetition fits a code where a digit may be used again.
- Number of items to choose from (n)
- The number of different items, such as runners in a race or symbols available for a code. Whole numbers from 0 to 10,000.
- Number of positions to fill (r)
- The number of positions to fill, in order. Without repetition, r can't be more than n.
Formula and method
P(n, r) = n! ÷ (n − r)! = n × (n − 1) × … × (n − r + 1) With repetition: N = n^r
The ! sign means factorial: multiply a whole number by every whole number below it, down to 1. So 4! = 4 × 3 × 2 × 1. Without repetition, the first position can be filled in n ways. The second can be filled in n − 1 ways, since one item is used up, and so on for r positions. Multiply these choices together, and you get n × (n − 1) × … × (n − r + 1). That's the same as n! divided by (n − r)!, because the leftover factors cancel out.
With repetition, any of the n items can fill every position. So the count is n multiplied by itself r times, written n^r. N is that total count. By agreement, 0! = 1 and 0^0 = 1. Both mean there's exactly one way to arrange nothing.
Worked example
Eight runners start a race. How many different ways can the gold, silver and bronze medals be awarded?
- Write the formula: P(8, 3) = 8! ÷ (8 − 3)! = 8! ÷ 5!.
- Cancel 5!, leaving the top three factors: 8 × 7 × 6.
- Multiply: 336.
Result: There are 336 possible podium finishes. Now say items could be reused, as in a 3-symbol code drawn from 8 symbols. Then there would be 8^3 = 512 possibilities.
Understanding the result
The count is the number of different ordered outcomes. If every arrangement is equally likely, the chance of one particular arrangement is 1 divided by the count. In the podium example, guessing all three medalists in order has a 1 in 336 chance.
Permutations always outnumber combinations (groups where order doesn't matter) of the same size by a factor of r!. That's because each group of r items can be put in r! orders. 336 podiums ÷ 3! = 56 possible groups of three medalists.
Assumptions and limitations
- The n items are all different. Rearranging a word with repeated letters, such as the anagrams of 'LETTER', needs a different formula that divides by the repeats.
- Order matters. If it doesn't, use the combination calculator.
- With repetition, every item is available for every position, with no limit.
- n and r are limited to 10,000. Results with more than 1,000 digits show how many digits there are, not every digit.
- Circular arrangements, such as seating around a round table, aren't handled directly. They're the straight-line count divided by the number of rotations.
- The calculator counts arrangements; it doesn't list them.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts ordered arrangements, and nCr counts groups where order doesn't matter. They're linked by nPr = nCr × r!. Picking a president, secretary and treasurer from 10 people is a permutation (720 ways). Picking a three-person committee is a combination (120 ways).
How many 4-digit PIN codes are possible?
Digits can repeat, so use permutations with repetition: 10^4 = 10,000 codes, from 0000 to 9999. If no digit could repeat, it would be P(10, 4) = 10 × 9 × 8 × 7 = 5,040.
Why is n! the number of ways to arrange n items?
The first position can take any of the n items. The second can take any of the remaining n − 1, and so on down to 1. Multiplying gives n!. It's the permutation count with r = n.
How big do factorials get?
Very big, very fast. 10! is 3,628,800, and 20! has 19 digits. 52!, the number of ways to shuffle a deck of cards, has 68 digits: about 8.065817517 × 10^67. The calculator keeps every digit exact.
How this calculator is checked
Method: Standard counting rules: falling factorial n!/(n−r)! and n^r for arrangements with repetition. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Permutation Calculator on your own website or blog for free. Paste this code where you want it to appear: