Permutation and Combination Calculator
A permutation counts the ways to pick and arrange items when order matters, and a combination counts the ways to pick them when order does not. For 5 items taken 3 at a time, P(5, 3) = 60 permutations and C(5, 3) = 10 combinations. Allowing repetition gives 5³ = 125 ordered sequences and C(5 + 3 − 1, 3) = 35 unordered selections. The calculator uses exact big-integer arithmetic for n and r up to 5,000, so it gives every digit of a huge result along with its digit count and scientific notation, works the formula out with your numbers, and for small cases lists the arrangements themselves (letters A, B, C …).
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
Permutations without repetition
P(5, 3) = 60
60 ways to choose and arrange 3 items from 5, each used at most once.
- Type
- Permutations without repetition
- Exact value
- 60
- Digits
- 2
- Scientific notation
- 6 × 10¹
- E notation
- 6e+1
- Check: C(n, r) × r!
- 10 × 6 = 60
The formula with your numbers
P(n, r) = n! ÷ (n − r)!
P(5, 3) = 5! ÷ (5 − 3)! = 5! ÷ 2!
Cancelling the common factors leaves the first 3 factors of 5!: 5 × 4 × 3
= 60
The full value
60
All 2 digits, no rounding.
All four counts for the same n and r
| Count | Formula | Result | Digits |
|---|---|---|---|
| Permutations without repetition (selected) | P(5, 3) | 60 | 2 |
| Combinations without repetition | C(5, 3) | 10 | 2 |
| Permutations with repetition | 5³ | 125 | 3 |
| Combinations with repetition | C(7, 3) | 35 | 2 |
The arrangements
All 60 arrangements, in dictionary order. The letters A to E stand for the items.
- ABC
- ABD
- ABE
- ACB
- ACD
- ACE
- ADB
- ADC
- ADE
- AEB
- AEC
- AED
- BAC
- BAD
- BAE
- BCA
- BCD
- BCE
- BDA
- BDC
- BDE
- BEA
- BEC
- BED
- CAB
- CAD
- CAE
- CBA
- CBD
- CBE
- CDA
- CDB
- CDE
- CEA
- CEB
- CED
- DAB
- DAC
- DAE
- DBA
- DBC
- DBE
- DCA
- DCB
- DCE
- DEA
- DEB
- DEC
- EAB
- EAC
- EAD
- EBA
- EBC
- EBD
- ECA
- ECB
- ECD
- EDA
- EDB
- EDC
The four formulas
| Count | Order matters? | Repeats allowed? | Formula | n = 10, r = 3 |
|---|---|---|---|---|
| Permutations | Yes | No | P(n, r) = n! ÷ (n − r)! | 720 |
| Combinations | No | No | C(n, r) = n! ÷ (r! × (n − r)!) | 120 |
| Permutations with repetition | Yes | Yes | n^r | 1,000 |
| Combinations with repetition | No | Yes | C(n + r − 1, r) | 220 |
Everyday counts
| Situation | Why this formula | Notation | Count |
|---|---|---|---|
| Awards for 1st, 2nd and 3rd place among 8 runners | Order matters, nobody places twice | P(8, 3) | 336 |
| A committee of 3 chosen from 8 people | Order ignored, no repeats | C(8, 3) | 56 |
| A 4-digit PIN | Order matters, digits repeat | 10⁴ | 10,000 |
| A 5-card poker hand from 52 cards | Order ignored, no repeats | C(52, 5) | 2,598,960 |
| A 6-number lottery draw from 49 balls | Order ignored, no repeats | C(49, 6) | 13,983,816 |
| An 8-letter lowercase password | Order matters, letters repeat | 26⁸ | 208,827,064,576 |
| A scoop of 3 flavours from 5, repeats allowed | Order ignored, repeats allowed | C(7, 3) | 35 |
| Shuffling a 52-card deck | All 52 in order: P(52, 52) = 52! | P(52, 52) | 8.06582 × 10⁶⁷ (68 digits) |
Pascal’s triangle: C(n, r) for small n
| n | C(n, r) for r = 0, 1, … n |
|---|---|
| 0 | 1 |
| 1 | 1, 1 |
| 2 | 1, 2, 1 |
| 3 | 1, 3, 3, 1 |
| 4 | 1, 4, 6, 4, 1 |
| 5 | 1, 5, 10, 10, 5, 1 |
| 6 | 1, 6, 15, 20, 15, 6, 1 |
| 7 | 1, 7, 21, 35, 35, 21, 7, 1 |
| 8 | 1, 8, 28, 56, 70, 56, 28, 8, 1 |
How to calculate permutations and combinations
- Decide whether order matters. If picking A then B differs from picking B then A (a podium, a PIN, a password), you want permutations. If only the group matters (a committee, a poker hand, a lottery draw), you want combinations. With 4 items taken 2 at a time there are 12 ordered pairs but only 6 groups.
- Decide whether items can repeat. If the same item can be used again (a digit in a PIN, a flavour in a scoop), allow repetition. If each item is used at most once (runners on a podium, cards in a hand), do not. Without repetition r cannot exceed n.
- Enter n and r. n is how many items you choose from and r is how many you pick. For 8 runners and 3 medals, n = 8 and r = 3. Both can be up to 5,000.
- Read the formula with your numbers. Permutations without repetition multiply r descending factors: 8 × 7 × 6 = 336 for 8 runners and 3 medals. Combinations divide that by r! because every group of r items was counted r! times: C(5, 3) = 60 ÷ 6 = 10.
- List the arrangements to check. Tick the list option to see them. For 4 items and 2 at a time the ordered pairs begin AB, AC, AD, BA, BC and the groups are AB, AC, AD, BC, BD, CD. Lists stop at 300 entries and work for n up to 26 and r up to 10.
Frequently asked questions
- What is the difference between a permutation and a combination?
- Order. A permutation is an ordered arrangement, so ABC and CBA are different; a combination is a group, so they are the same. From 5 items taking 3, there are 60 permutations and 10 combinations, and the ratio is 3! = 6, the number of ways to order any one group.
- What are the formulas for nPr and nCr?
- nPr = n! ÷ (n − r)! and nCr = n! ÷ (r! × (n − r)!). For n = 10 and r = 3, nPr = 10 × 9 × 8 = 720 and nCr = 720 ÷ 3! = 120. Both need 0 ≤ r ≤ n.
- How do permutations and combinations with repetition work?
- With repetition each of the r positions can be any of n items, so ordered sequences number n^r, for example 10⁴ = 10,000 four-digit PINs. Unordered selections with repetition number C(n + r − 1, r), the “stars and bars” count: C(7, 3) = 35 ways to take 3 scoops from 5 flavours. Here r may be larger than n.
- What is 0! and what are nP0 and nC0?
- 0! is defined as 1, so nP0 = nC0 = 1 for every n: there is exactly one way to pick nothing. Likewise nPn = n! and nCn = 1. This calculator accepts r = 0 and shows 1 with an empty list entry.
- Why is nCr the same as nC(n − r)?
- Choosing the r items to take is the same as choosing the n − r items to leave behind. For example C(52, 5) and C(52, 47) are both 2,598,960. The calculator uses the smaller side to keep the working short.
- How many 5-card poker hands are there?
- 2,598,960, which is C(52, 5): order does not matter and a card cannot be dealt twice. If order did matter it would be P(52, 5) = 311,875,200.
- How many ways can a deck of 52 cards be ordered?
- 52! = P(52, 52), which has 68 digits and is about 8.06582 × 10⁶⁷. That is why a well-shuffled deck is almost certainly in an order that has never occurred before. The calculator shows all 68 digits.
- What are the chances in a 6-from-49 lottery?
- There are C(49, 6) = 13,983,816 possible draws, so one ticket has a 1 in 13,983,816 chance of matching all six, provided the order the balls come out does not matter.
- Why does the result switch to scientific notation?
- Counts grow fast: 30! is already 2.65253 × 10³², with 33 digits. Results of 15 digits or fewer are shown in full in the headline; longer ones show the first six significant digits as scientific notation and the digit count, and the full-value block shows every digit (the first 2,000 for very long ones; Copy result copies them all).
- How big can n and r be?
- Up to 5,000 each. The arithmetic uses exact BigInt integers, so nothing is rounded: even 5000 raised to the power 5000 is computed digit for digit (18,495 digits). The cap only keeps the page fast.
- Can the calculator list the actual arrangements?
- Yes, for n up to 26 and r up to 10. The items are the letters A, B, C … and the results appear in dictionary order, up to 300 at a time. For 4 items taken 2 at a time without repetition the 12 permutations begin AB, AC, AD, BA; the 6 combinations are AB, AC, AD, BC, BD, CD.
- Why can’t r be larger than n without repetition?
- Each item can be used only once, so you cannot pick more items than you have. Mathematically nPr and nCr are 0 in that case, and the calculator asks you to lower r or allow repetition instead. With repetition r can exceed n, as in 26⁸ for an 8-letter password from 26 letters (208,827,064,576 possibilities).
How it works
Everything is computed with exact BigInt integers, so no result is rounded and no digit is lost. Permutations without repetition multiply the r factors n × (n − 1) × … × (n − r + 1). Combinations use the smaller of r and n − r and build up C(n, k) one factor at a time, dividing exactly at every step, which equals n! ÷ (r! × (n − r)!) without ever forming the full factorials. Permutations with repetition are n raised to the power r (0^0 counts as 1), and combinations with repetition are C(n + r − 1, r), the multiset coefficient (“stars and bars”). The digit count is the length of the exact decimal value; scientific notation keeps six significant digits, rounded half up, and the E notation is the same value written for spreadsheets. n must be at least 1 and r at least 0, both at most 5,000. Without repetition r may not exceed n. The lists use the letters A to Z in dictionary order and stop after 300 entries. Everything runs in your browser and nothing you type is sent anywhere.
Sources
- Permutation, Wolfram MathWorld
- Combination, Wolfram MathWorld
- Multiset, Wolfram MathWorld (combinations with repetition)
- Donald E. Knuth, The Art of Computer Programming, Vol. 1: Fundamental Algorithms, §1.2.6 “Binomial Coefficients” (Addison-Wesley)
More free tools
- Dice RollerRoll d4 to d100 or any custom die with dice notation like 3d6+2, 4d6kh3 or 2d20kl1, and see the exact odds of every total. Fair and rolled on your device.
- Random Number GeneratorPick a random number between any two numbers, draw several with or without repeats, flip a coin or roll dice. Fair, unbiased and drawn on your device.
- Scientific Notation ConverterConvert any number to scientific, E and engineering notation or back to standard form, round to significant figures, and count the sig figs you typed.
- GCF and LCM CalculatorFind the GCF (GCD) and LCM of 2 to 20 numbers with Euclid’s algorithm, prime factors and multiples shown, plus Bézout coefficients and fraction reduction.
- Arithmetic and Geometric Sequence CalculatorFind the nth term, the sum of the first n terms, the formulas and the infinite sum of an arithmetic, geometric or Fibonacci-like sequence, step by step.
- Probability CalculatorFind P(A and B), P(A or B), P(not A) and P(A|B) for two events, binomial probabilities for repeated trials, and odds to probability, as exact fractions.
More: Algebra and number theoryAll math & numbersAll toolsHome & DIY calculators