Permutation and Combination Calculator

Find the number of permutations (order matters) and combinations (order does not matter) for choosing r items from n, with or without repetition, with exact results.

Permutation and combination calculator
Permutations and combinations

    Working

    Permutations count arrangements where order matters; combinations count selections where order doesn't. Results are exact whole numbers, however large.

    On this page

    A permutation and combination calculator counts how many ways you can choose r items from a set of n, either when the order matters (permutations) or when it doesn’t (combinations), with or without repetition. It gives exact answers however large they get, shows the factorial formulas with your numbers, and lists the related counts side by side so you can compare them.

    For example, choosing 3 items from 10 gives 720 permutations but only 120 combinations. A standard 52-card deck gives 2,598,960 different five-card poker hands, and a 6-from-49 lottery has 13,983,816 possible combinations.

    How to use the calculator

    1. Enter n, the total number of items you can choose from.
    2. Enter r, how many items you choose.
    3. Say whether items can be repeated. Choose No for things like people on a team or cards in a hand, and Yes for things like digits in a PIN.
    4. Press Calculate to see the permutations, the combinations and the working.

    Permutations vs combinations

    The key question is: does the order matter?

    • Permutations count arrangements where order matters. Gold, silver and bronze medals for Ana, Ben and Cara is a different outcome from gold, silver and bronze for Cara, Ben and Ana.
    • Combinations count selections where order doesn’t matter. Choosing Ana, Ben and Cara for a committee is the same committee whichever order you pick them in.

    Every combination of r items can be arranged in r! different orders, so there are always r! times as many permutations as combinations. For 3 items, 3! = 6, which is why 720 ÷ 6 = 120.

    The formulas

    TypeOrder matters?Repetition?Formula
    PermutationYesNoP(n, r) = n! ÷ (n − r)!
    CombinationNoNoC(n, r) = n! ÷ (r! × (n − r)!)
    Permutation with repetitionYesYesnr
    Combination with repetitionNoYesC(n + r − 1, r)

    The exclamation mark means factorial: n! = n × (n − 1) × … × 2 × 1. So 5! = 120. By definition, 0! = 1. Combinations are also written as ⁿCᵣ, ₙCᵣ or “n choose r”, and permutations as ⁿPᵣ or ₙPᵣ.

    Worked examples

    A race podium (permutation)

    Eight runners compete for gold, silver and bronze. Order matters and no runner can win two medals, so the number of possible podiums is P(8, 3) = 8 × 7 × 6 = 336.

    A committee (combination)

    A club picks 4 members from 12 for a committee. Order doesn’t matter, so the number of possible committees is C(12, 4) = (12 × 11 × 10 × 9) ÷ (4 × 3 × 2 × 1) = 11,880 ÷ 24 = 495.

    A PIN code (permutation with repetition)

    A 4-digit PIN uses digits 0 to 9, and digits can repeat. Each of the four positions has 10 choices, so there are 10⁴ = 10,000 possible PINs.

    Ice cream scoops (combination with repetition)

    You choose 3 scoops from 5 flavours, and you can have the same flavour more than once. The order of scoops in the cup doesn’t matter, so the count is C(5 + 3 − 1, 3) = C(7, 3) = 35.

    Lottery odds

    In a lottery where you pick 6 numbers from 49, the order of the numbers doesn’t matter, so there are C(49, 6) = 13,983,816 possible tickets. Your chance of matching all six with one ticket is 1 in 13,983,816.

    Why permutations grow so quickly

    Factorials grow extremely fast. 10! is 3,628,800, and 52!, the number of ways to shuffle a deck of cards, has 68 digits. That’s so large that every properly shuffled deck in history has almost certainly been in an order never seen before. This calculator uses exact whole-number arithmetic, so it gives precise answers for very large values, and shows them in scientific notation alongside the exact digits.

    Useful properties

    • C(n, r) = C(n, n − r). Choosing 3 people to include from 10 is the same as choosing 7 to leave out, so both give 120.
    • C(n, 0) = C(n, n) = 1. There’s exactly one way to choose nothing, or everything.
    • P(n, n) = n!, the number of ways to arrange all n items.
    • C(n, r) = C(n − 1, r − 1) + C(n − 1, r), the rule behind Pascal’s triangle.
    • The combinations C(n, r) are the coefficients in the binomial expansion of (a + b)n.

    How to decide which formula to use

    1. Ask whether swapping the order gives a different result. If yes, use permutations; if no, use combinations.
    2. Ask whether the same item can be chosen more than once. If yes, use the repetition formulas.
    3. Check for restrictions, such as “the first digit can’t be 0” or “two people refuse to sit together”. These need extra steps, often by multiplying choices position by position or subtracting the arrangements you don’t want.

    For instance, a licence plate with 3 letters followed by 3 digits, where repeats are allowed, has 26 × 26 × 26 × 10 × 10 × 10 = 17,576,000 possibilities. Each position is filled independently, so you multiply the choices.

    Arrangements with repeated letters

    When some of the items are identical, swapping them doesn’t create a new arrangement, so you divide by the factorial of each repeat count. The word LEVEL has 5 letters, with L appearing twice and E appearing twice. The number of distinct arrangements is 5! ÷ (2! × 2!) = 120 ÷ 4 = 30. The word BANANA has 6 letters, with A three times and N twice, giving 6! ÷ (3! × 2!) = 720 ÷ 12 = 60 distinct arrangements. This is sometimes called a multinomial or a permutation of a multiset.

    Circular arrangements

    Seating people around a round table is different from seating them in a row, because rotating everyone one seat to the left gives the same arrangement. To count circular arrangements of n people, fix one person’s seat and arrange the others: (n − 1)!. Six people around a round table can be seated in 5! = 120 different ways, compared with 6! = 720 ways in a row. If clockwise and anticlockwise orders count as the same, such as beads on a necklace that can be flipped over, divide by 2 again.

    Using combinations to find probabilities

    Combinations are the backbone of many probability questions. The probability of an outcome is the number of favourable combinations divided by the total number of combinations. For example, what’s the chance that a five-card hand contains all four aces? There are 48 ways to choose the fifth card, and C(52, 5) = 2,598,960 hands in total, so the probability is 48 ÷ 2,598,960, or about 1 in 54,145. In a lottery where you pick 6 numbers from 49, the chance of matching exactly 3 is C(6, 3) × C(43, 3) ÷ C(49, 6) = 20 × 12,341 ÷ 13,983,816, about 1.77%, or roughly 1 in 57.

    Where counting is used

    Permutations and combinations appear far beyond the classroom. Security experts use them to measure how hard a password is to guess. Scientists count the possible orders of genes or proteins. Sports leagues count fixture lists, schedulers count possible rotas, and card players and game designers rely on them to work out odds. Whenever you need to know “how many ways”, one of these four formulas is usually the starting point.

    Common mistakes

    • Using permutations when order doesn’t matter, which overcounts by a factor of r!.
    • Calling a “combination lock” a combination. The order of the digits matters, so it’s really a permutation with repetition.
    • Forgetting that 0! equals 1, not 0.
    • Using the without-repetition formula for PINs or passwords, where characters can repeat.

    Related calculations

    You may also find the probability calculator useful to find the probability of combined events, while the random number generator lets you generate random numbers in any range.

    Frequently asked questions

    In a permutation the order matters; in a combination it doesn't. ABC and CBA are two permutations but one combination.

    nPr = n! ÷ (n − r)!. For 10P3, that's 10 × 9 × 8 = 720.

    nCr = n! ÷ (r! × (n − r)!). For 10C3, that's 720 ÷ 6 = 120.

    0! = 1. There's exactly one way to arrange zero items, and this definition keeps the formulas consistent.

    C(52, 5) = 2,598,960, because the order of cards in a hand doesn't matter.

    10⁴ = 10,000, from 0000 to 9999, since each digit can be any of 10 and digits can repeat.

    A selection where order doesn't matter and items can be chosen more than once, such as scoops of ice cream. The count is C(n + r − 1, r).

    Because the order of the numbers matters. Mathematically it's a permutation with repetition.

    Only when repetition is allowed. Without repetition you can't choose more distinct items than there are.

    1 in 13,983,816 for a single ticket, because there are C(49, 6) possible combinations.

    n and r can each be up to 10,000. The calculator uses exact arithmetic and shows very large results in scientific notation with the number of digits.

    (6 − 1)! = 120, because rotating everyone by one seat gives the same arrangement.

    5! = 120, since every person can sit in any remaining seat and order matters.