About this tool
A permutation is an arrangement where order matters: race podiums, seating plans, passwords and anagrams. The number of ways to arrange r of n distinct items is written P(n, r) or nPr. This calculator also handles arrangements with repetition and arrangements of a multiset, where some items are identical. It uses exact whole-number arithmetic and shows each step.
How it works
Choose the kind of arrangement first. "Without repetition" counts ordered selections of r different items from n, such as the gold, silver and bronze finishers in a race. "With repetition" lets an item be used again, as with the digits of a PIN code. "Repeated letters" counts the distinct orderings of a word or set with identical items, such as the letters of MISSISSIPPI.
For the first two modes, enter n and r. For repeated letters, type a word (letters are counted regardless of case and spaces are ignored) or the sizes of the identical groups separated by commas. The result is exact, with a worked solution, and small sets can be listed in full.
Example
Ten runners can finish first, second and third in ways. A 4-digit PIN, where digits may repeat, has possibilities.
The word MISSISSIPPI has 11 letters: one M, four I, four S and two P. Swapping identical letters gives the same word, so divide by their factorials: distinct arrangements.
Permutation table
P(n, r) for n and r up to 8
| n \ r | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | |||||||
| 2 | 2 | 2 | ||||||
| 3 | 3 | 6 | 6 | |||||
| 4 | 4 | 12 | 24 | 24 | ||||
| 5 | 5 | 20 | 60 | 120 | 120 | |||
| 6 | 6 | 30 | 120 | 360 | 720 | 720 | ||
| 7 | 7 | 42 | 210 | 840 | 2,520 | 5,040 | 5,040 | |
| 8 | 8 | 56 | 336 | 1,680 | 6,720 | 20,160 | 40,320 | 40,320 |
Each row ends with . Moving one column to the right multiplies by the next factor: .
Assumptions and limits
n and r can be any whole numbers up to 10,000, and a word or set of groups can contain up to 10,000 items in total. Without repetition, r cannot exceed n. Results are exact; huge values are summarized in scientific notation with all digits available. Arrangements are listed only when there are at most 1,000.
Frequently asked questions
What is the formula for permutations?
Without repetition, , which is the product of the r numbers counting down from n. With repetition each of the r positions has n choices, so the count is .
How many ways can you arrange the letters of a word?
Divide the factorial of the number of letters by the factorial of each letter's count. BANANA has 6 letters with three A and two N, so it has distinct arrangements.
What is the difference between a permutation and a combination?
Permutations count ordered arrangements; combinations count unordered selections. Each combination of r items can be ordered in ways, so .
How many 4-digit PIN codes are there?
Each of the 4 digits can be any of 10, with repeats allowed, so there are codes from 0000 to 9999. If digits could not repeat, there would be .
What is P(n, n)?
Arranging all n items gives , because . For example, 5 books can be lined up on a shelf in ways.
Link with your values
Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.
| Parameter | Value | If omitted |
|---|---|---|
modeArrangement type | one of: standard, repetition, multiset | default standard |
nTotal items (n) | whole number; allowed 0–10000; used with mode = standard, repetition | required |
rItems chosen (r) | whole number; allowed 0–10000; used with mode = standard, repetition | required |
itemsItem names (optional) | text; used with mode = standard, repetition; your own text; Copy link includes it | optional |
wordWord or group sizes | text; used with mode = multiset; your own text; Copy link includes it | required |
Examples
?n=8&r=3?mode=repetition&n=26&r=4?word=BANANA?items=Red,Green,Blue&r=2
Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.
Result elements: [data-result-block="permutation_calculator"]