How to use the permutation and combination calculator
- Type the total number of items into n (total items) and how many you pick into r (items chosen). The page opens with n = 10 and r = 3.
- Read the two large boxes: Combinations C(n, r) when the order of the picks does not matter, and Permutations P(n, r) when it does.
- Below them, Permutations with repetition and Combinations with repetition give the answers when an item can be picked more than once.
- Tap an example under Try an example (Poker hand, Lottery 6/49, 4-digit PIN), or use Copy results to copy all four numbers.
The formulas
- Permutations:
P(n, r) = n! / (n - r)!, which is n ร (n - 1) ร ... ร (n - r + 1). - Combinations:
C(n, r) = n! / (r! ร (n - r)!), which equals P(n, r) / r!. - Permutations with repetition:
n^r. - Combinations with repetition:
C(n + r - 1, r).
These are the standard definitions for a permutation, a combination and the binomial coefficient. The calculator multiplies exact whole numbers one step at a time instead of dividing giant factorials, so results stay exact even with thousands of digits.
Worked example with the default values
With n = 10 and r = 3 the tool shows:
- P(10, 3) = 10 ร 9 ร 8 = 720
- C(10, 3) = 720 รท (3 ร 2 ร 1) = 120
- Permutations with repetition: 10^3 = 1,000
- Combinations with repetition: C(12, 3) = 220
Each group of 3 can be lined up in 3! = 6 orders, so 720 arrangements collapse into 720 รท 6 = 120 groups.
Real uses
- Poker. With n = 52 and r = 5, C(52, 5) = 2,598,960 possible five-card hands.
- Lottery. With n = 49 and r = 6, C(49, 6) = 13,983,816 tickets, so one ticket wins the jackpot 1 time in 13,983,816.
- PIN codes. With n = 10 and r = 4, digits can repeat and order matters, so 10^4 = 10,000 codes.
Limits and edge cases
- n and r must be whole numbers from 0 to 5,000. Decimals, negatives and blanks get a message next to the field.
- If r is larger than n, the no-repeat answers are 0, because you cannot pick 5 different items from 3. The repetition answers still work: for n = 3 and r = 5 they are 3^5 = 243 and C(7, 5) = 21.
- With r = 0 all four answers are 1: there is one way to choose nothing.
- Results over 30 digits show in scientific notation, with every digit under Show all digits.
To turn counts into odds, use the probability calculator. To work with n! directly, use the factorial calculator.
Frequently asked questions
What is the difference between a permutation and a combination?
Order. A permutation counts different orders as different results, like president, vice president and treasurer. A combination does not, like a three-person committee. That is why P(n, r) is always r! times C(n, r).
How many 5-card poker hands are there?
There are 2,598,960 hands, which is C(52, 5). Choose Poker hand under Try an example to see it.
What are the odds of winning a 6/49 lottery?
The odds are 1 in 13,983,816, because there are C(49, 6) = 13,983,816 equally likely combinations of six numbers.
How many 4-digit PIN codes are there?
There are 10,000. Digits can repeat and order matters, so it is a permutation with repetition: 10^4 = 10,000.
Why is C(n, 0) equal to 1?
There is exactly one way to choose nothing: pick no items. In the formula, 0! = 1, so C(n, 0) = n! / (0! ร n!) = 1.
Sources: Wolfram MathWorld, Permutation; Wolfram MathWorld, Combination; NIST Digital Library of Mathematical Functions, section 26.3 (binomial coefficients).