Permutations Calculator (nPr)
Type how many items there are and how many places to fill to count the arrangements…
Type how many items there are and how many places to fill to count the arrangements where order matters, with each one listed when there are few.
ExamplePermutations, 4P3
24
There are 24 ways to arrange 3 of 4 in order. If order didn’t matter there would be 4.
Type your own n and r.
All 24, with the items named A, B, C, D:
- ABC
- ABD
- ACB
- ACD
- ADB
- ADC
- BAC
- BAD
- BCA
- BCD
- BDA
- BDC
- CAB
- CAD
- CBA
- CBD
- CDA
- CDB
- DAB
- DAC
- DBA
- DBC
- DCA
- DCB
- If order didn’t matter
- 4
- Digits
- 2
How this works: 8 sources,
How this works
Method
A permutation is an arrangement where order matters: finishing places in a race, the letters of a code, the order of songs on a playlist. Fill the places one at a time: n choices for the first, n − 1 for the second, and so on for r places. So P(n, r) = n × (n − 1) × … × (n − r + 1) = n! ÷ (n − r)!. Full method
Sources
- Wikipedia, Permutation
- NIST/SEMATECH e-Handbook of Statistical Methods
- Abramowitz and Stegun, Handbook of Mathematical Functions, chapters 6, 7 and 26 (1964)
- SciPy 1.18 scipy.stats (reference values for the tests)
- statsmodels 0.15 (reference values for the A/B test and regression intervals)
- Welch, The generalization of Student’s problem when several different population variances are involved (Biometrika) (1947)
- Fleiss, Levin and Paik, Statistical Methods for Rates and Proportions, 3rd edition (sample size for two proportions) (2003)
- Hyndman and Fan, Sample quantiles in statistical packages (The American Statistician) (1996)
How it’s tested
2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Privacy
On your device. Nothing you enter or open leaves this browser. About privacy labels
Changes
- First published: live curves with draggable cut-offs, and tests on pasted data (t-tests, ANOVA, chi-square, Fisher’s exact, correlation, regression, A/B), checked against SciPy.
How to count permutations
A permutation is an arrangement where order matters: finishing places in a race, the letters of a code, the order of songs on a playlist. Fill the places one at a time: n choices for the first, n − 1 for the second, and so on for r places. So P(n, r) = n × (n − 1) × … × (n − r + 1) = n! ÷ (n − r)!.
Gold, silver and bronze among 8 runners can go 8 × 7 × 6 = 336 ways. All 4 letters of a word with no repeated letters can be arranged in 4! = 24 orders, and a shuffled deck of 52 cards is one of 52! ≈ 8.07 × 10⁶⁷ orders, a number so large that a well-shuffled deck has almost certainly never been in that order before.
When an item can be used again, every place has all n choices, so there are nʳ arrangements. A 4-digit PIN has 10⁴ = 10,000 possibilities, while a 4-digit code with no digit repeated has P(10, 4) = 5,040.
P(n, r) = n! ÷ (n − r)! · with repeats nʳ
- The number of permutations of n distinct objects is n!, and of r objects chosen from n is n!/(n − r)!. Source: Wikipedia, Permutation.
- The number of orders of a standard 52-card deck is 52! ≈ 8.07 × 10⁶⁷. Source: Wikipedia, Permutation.
Permutations people look up
How many ordered arrangements of r items from n there are, with and without repeats.
| Arrangement | n | r | Without repeats | With repeats |
|---|---|---|---|---|
| Podium of 3 from 8 runners | 8 | 3 | 336 | 512 |
| 4-letter word, all letters | 4 | 4 | 24 | 256 |
| 4-digit code | 10 | 4 | 5,040 | 10,000 |
| 3-letter initials | 26 | 3 | 15,600 | 17,576 |
| Batting order of 9 | 9 | 9 | 362,880 | 387,420,489 |
| 5 songs from 20 | 20 | 5 | 1,860,480 | 3,200,000 |
| Seating 6 people in 6 chairs | 6 | 6 | 720 | 46,656 |
| 2 officers from a club of 30 | 30 | 2 | 870 | 900 |
| 6-character password from 62 | 62 | 6 | 44,261,653,680 | 56,800,235,584 |
Common questions
How many ways can n things be arranged?
n! (n factorial): 3 things in 6 orders, 5 in 120, 10 in 3,628,800. It is P(n, n).
What about repeated letters, as in BANANA?
Divide by the orders of each repeated letter: 6! ÷ (3! × 2!) = 60 distinct arrangements of BANANA, since its three As and two Ns are interchangeable.
Is a combination lock really a permutation lock?
In maths terms, yes: 1-2-3 and 3-2-1 open different locks, so order matters. A 3-dial lock with digits 0 to 9 has 10³ = 1,000 settings.