Skip to content
DeviceCheckHub

Permutation and Combination Calculator

Count the ways to choose or arrange r items from n, with or without repeats, exactly, with steps and every arrangement listed.

Your numbers

Enter n, the number of items, and r, how many you choose.

List every one

Such as red, green, blue, yellow. The number of items becomes n.

Type a few items, separated by commas, to list every one.

    Arrange the letters of a word

    Enter a word to count the different ways to arrange its letters.

    How to use the permutation and combination calculator

    1. Enter n, the number of items you choose from, and r, how many you choose.
    2. Choose what you are counting: combinations if order doesn’t matter, permutations if it does, and whether items can repeat. The table shows all four counts at once.
    3. Follow the steps, or type your items to see every arrangement listed. The last panel counts the arrangements of a word’s letters.

    Permutations or combinations: does order matter?

    Both count ways of choosing r things from n. The difference is whether the order of the choice matters.

    A quick test: if swapping two of the chosen items gives a different result, it is a permutation.

    The formulas

    The exclamation mark is the factorial: n! = n × (n − 1) × … × 2 × 1, so 5! = 120, and 0! is defined as 1. In practice, most of each factorial cancels: 10! / 7! leaves just 10 × 9 × 8. The calculator shows this cancelled form in its steps.

    When items can repeat

    If an item can be chosen more than once, the counts grow. A 4-digit PIN is a permutation with repetition: each digit can be any of 10, so there are 10⁴ = 10,000 PINs. Choosing 3 scoops of ice cream from 5 flavors, where two scoops can be the same flavor and the order in the bowl doesn’t matter, is a combination with repetition: C(5 + 3 − 1, 3) = C(7, 3) = 35 ways. This is often worked out with the “stars and bars” picture: 3 stars for the scoops and 4 bars to split them into 5 flavors, arranged in a row of 7.

    Arranging the letters of a word

    A word with all different letters can be arranged in n! ways: STOP has 4! = 24. When letters repeat, swapping two identical letters doesn’t make a new word, so divide by the factorial of each letter’s count. MISSISSIPPI has 11 letters, with 4 I’s, 4 S’s and 2 P’s, so it has 11! / (4! × 4! × 2!) = 34,650 different arrangements.

    Probability and odds

    Counting is the first step of many probability questions: when every outcome is equally likely, the chance of one particular outcome is 1 divided by the number of outcomes. In a lottery that draws 6 numbers from 49, the order doesn’t matter, so there are 49C6 = 13,983,816 possible tickets, and one ticket has a 1 in 13,983,816 chance of matching all six. There are 52C5 = 2,598,960 different 5-card hands from a standard deck. The Common Core high school standards include this use directly: “use permutations and combinations to compute probabilities of compound events and solve problems” (standard HSS-CP.B.9).

    The multiplication rule behind both

    Both formulas come from one idea, the multiplication rule: if one choice can be made in a ways and a second in b ways, the two together can be made in a × b ways. A restaurant with 3 starters, 5 mains and 4 desserts offers 3 × 5 × 4 = 60 different three-course meals. A permutation applies the rule with one option fewer each time, so 10 runners can take gold, silver and bronze in 10 × 9 × 8 = 720 ways. A combination then divides by the number of orders of each group, 3! = 6 for a group of 3, which leaves 120. When a problem has several separate steps, such as choosing 2 of 6 men and 2 of 5 women for a team, count each step and multiply: 6C2 × 5C2 = 15 × 10 = 150.

    Pascal’s triangle and symmetry

    The combinations nCr are the numbers in Pascal’s triangle: row n, position r, counting from 0. Each number is the sum of the two above it, which is the rule nCr = (n − 1)C(r − 1) + (n − 1)Cr. Choosing r items to take is the same as choosing n − r to leave behind, so nCr = nC(n − r): 10C3 and 10C7 are both 120. And because each item is either chosen or not, all the combinations of n items add up to 2ⁿ.

    Common mistakes

    Big numbers, exactly

    Factorials grow fast. 20! is already 2,432,902,008,176,640,000, and the number of ways to shuffle a deck of 52 cards, 52!, has 68 digits. Ordinary calculators round these to a few digits. This calculator works with whole numbers of any size, so it gives the exact count for n and r up to 1,000, along with a short scientific-notation version of very long answers.

    Your data stays on your device

    Everything is worked out in your browser. Nothing you type is sent anywhere or stored.

    Frequently asked questions

    What is the difference between a permutation and a combination?

    In a permutation the order matters; in a combination it doesn’t. Picking a president, secretary and treasurer from 10 people is a permutation, 720 ways, because the jobs differ. Picking a committee of 3 is a combination, 120 ways, because the same three people make the same committee in any order.

    What is the formula for nCr?

    nCr = n! / (r! (n − r)!), where n! means n × (n − 1) × … × 1. For 10C3: 10! / (3! × 7!) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120.

    What is the formula for nPr?

    nPr = n! / (n − r)!, which is the first r terms of n × (n − 1) × (n − 2) × …. For 10P3: 10 × 9 × 8 = 720.

    How many 4-digit PINs are there?

    10,000. Each of the 4 digits can be any of 10, and digits can repeat, so there are 10⁴ = 10,000, from 0000 to 9999. That is a permutation with repetition.

    Why is 0! equal to 1?

    There is exactly one way to arrange nothing: do nothing. Defining 0! = 1 also keeps the formulas working, so that choosing all n items, nCn = n! / (n! × 0!), comes out as 1.

    Is anything I type saved or sent?

    No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.

    Last updated · About DeviceCheckHub