Permutations Calculator
Enter how many items you can choose from and how many places you are filling, and the calculator counts the different ordered arrangements. Tick the repetition box when the same item may be used more than once.
Related calculators
Created by the Reeliy Editorial Team. Last updated: Oct 19, 2026
What is a permutation?
A permutation is an arrangement of items in which the order matters. The sequences 1-2-3 and 3-2-1 use the same three digits but are two different permutations, just as first, second and third place on a podium are three different roles even when the same three runners are involved.
The number of ways to fill r ordered positions from n available items is written P(n, r), nPr, or sometimes (n)_r. When you only care about which items end up selected and not the order, you are counting combinations instead; the combination calculator handles that case.
How to use the calculator
- Enter the number of distinct items available in Choose from (n).
- Enter how many positions you are filling in How many? (r).
- Decide about With repetition. Leave it ticked if an item can be reused (digits of a PIN, letters of a code). Untick it if each item can appear only once (runners on a podium, cards dealt from a deck).
- Press Calculate. The count appears in the Permutations row.
The box is ticked when the page opens, so the first answer you see is the repetition version. Both numbers must be whole numbers of at least 1; values such as 5.5 or 3.0 are rejected.
Without repetition you cannot fill more places than you have items. If you enter an r larger than n, the calculator treats it as r = n and returns the number of ways to arrange all n items (n!).
Permutation formulas
Without repetition there are n choices for the first position, n − 1 for the second, n − 2 for the third, and so on until r positions are filled. Multiplying these gives:
P(n, r) = n! ÷ (n − r)! = n × (n − 1) × … × (n − r + 1)Each item can be used at most once.
With repetition every position has all n options, so the choices simply multiply:
nrEach position is chosen independently from all n items.
Arranging all n items without repetition is the special case r = n, which gives n! (n factorial). The factorial grows very quickly: 5! = 120, 10! = 3,628,800 and 20! is already about 2.4 × 1018.
Worked examples
Choosing 3 of 5, in order. P(5, 3) = 5 × 4 × 3 = 60. If the same item may be repeated, the count rises to 53 = 125.
A podium. Eight runners compete for gold, silver and bronze. The medals can be awarded in P(8, 3) = 8 × 7 × 6 = 336 different ways.
A four-digit PIN. If digits may repeat there are 104 = 10,000 possible PINs. If every digit must be different, there are P(10, 4) = 10 × 9 × 8 × 7 = 5,040. Banning repeated digits removes almost half of the possibilities, which is a good reason not to.
Shelving books. Seven different books can be placed in a row in 7! = 5,040 orders.
| r | Without repetition, P(5, r) | With repetition, 5r |
|---|---|---|
| 1 | 5 | 5 |
| 2 | 20 | 25 |
| 3 | 60 | 125 |
| 4 | 120 | 625 |
| 5 | 120 | 3,125 |
Permutations versus combinations
Every combination of r items can be arranged in r! different orders, so the two counts are linked by a simple relationship:
P(n, r) = C(n, r) × r!
Picking 3 of 8 runners as a team (order irrelevant) can be done in C(8, 3) = 56 ways, and each team can stand on the podium in 3! = 6 orders, giving 56 × 6 = 336 podiums, the same figure as above. A quick test: if swapping two chosen items gives a different outcome, count permutations; if it gives the same outcome, count combinations.
Limits of the calculator
- The tool works in standard double-precision arithmetic. Counts above about 15 significant digits are shown as the exact value of the nearest representable number, so the trailing digits of a very large result are not meaningful.
- Factorials above 170! exceed the largest number a double can hold. Without repetition that happens when n is above 170, and the display then reads
inf(too large) ornan(not a number, produced when two overflowing factorials are divided). With repetition, results above roughly 10308 show asinf. - For counts that large, work with logarithms or use arbitrary-precision software.
Common mistakes
- Using nr when items cannot repeat, or P(n, r) when they can.
- Counting permutations when the problem is really about unordered groups, which overcounts by a factor of r!.
- Treating identical objects as distinct. Arranging the letters of BALLOON, for instance, needs a further division by the factorials of the repeated letters, which this simple calculator does not do.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts ordered arrangements and nCr counts unordered selections. They are related by nPr = nCr × r!, so nPr is always at least as large as nCr.
How many ways can 5 people be arranged in a line?
All five are used, so the answer is 5! = 120. In the calculator, enter 5 and 5 and untick With repetition.
What does "with repetition" mean?
It means each position is filled independently from the full set, so the same item can appear in several positions, as digits do in a PIN. The count is then n to the power r.
Why does the calculator show inf or nan?
Factorials above 170! are too large for standard double-precision numbers. The result is shown as inf when the number overflows and nan when the calculation would need to divide one overflowed value by another.
References
- Rosen, K. H. Discrete Mathematics and Its Applications. McGraw-Hill (chapter on counting and permutations).
- Graham, R. L., Knuth, D. E., Patashnik, O. (1994). Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Addison-Wesley.
Cite this calculator and page
If you use this page in your work, you can cite it as:
Reeliy Editorial Team. (2026). Permutations Calculator. Reeliy. https://reeliy.com/calculators/permutation-calculator“Permutations Calculator.” Reeliy, 2026, https://reeliy.com/calculators/permutation-calculator.