Permutation and Combination Calculator: nPr, nCr & Repeats

A bike “combination lock” is badly named. If the code is 4-1-7, then 7-1-4 won’t open it, so the order of the numbers matters. In math terms that makes it a permutation lock. A real combination is a group where order doesn’t matter, like the three toppings on a pizza. Pepperoni, mushroom and olive is the same pizza in any order.

That one question, does order matter, decides which formula to use. A second question, can an item be used more than once, decides the rest. This calculator answers all four cases at once, counts arrangements of words with repeated letters, and can list every pick for small sets so you can see what is being counted.

Permutation & Combination Calculator

You get all four counts at once: with and without order, with and without repeats. Answers are exact, with every digit.

Count –
Pascal’s triangle (C(n, r) highlighted)
Step by step

    Does Order Matter? The Question That Picks the Formula

    Every counting problem in this family falls into one of four boxes:

    No repeatsRepeats allowed
    Order matters (permutations)nPr = n! ÷ (n − r)!nʳ
    Order doesn’t matter (combinations)nCr = n! ÷ (r! × (n − r)!)C(n + r − 1, r)

    Here n is how many items you choose from and r is how many you pick. One example of each:

    • Gold, silver and bronze among 8 runners: order matters, and a runner can’t win twice. 8P3 = 336.
    • 3 toppings from a list of 10: order doesn’t matter, and no topping is used twice. 10C3 = 120.
    • A 4-digit PIN: order matters, and digits can repeat. 10⁴ = 10,000.
    • 3 scoops from 5 ice-cream flavors, doubles allowed: order doesn’t matter, and flavors can repeat. C(7, 3) = 35.

    Type n and r into the nPr and nCr tab and all four counts appear together, so you can pick the box that matches your problem. When a result is long, the calculator shows it in scientific form and keeps every digit one click away.

    nPr: Count the Choices Slot by Slot

    Fill the podium one place at a time. Any of the 8 runners can win gold. Once gold is taken, 7 are left for silver, then 6 for bronze:

    8 × 7 × 6 = 336

    That is all nPr is: start at n and multiply r numbers, counting down. The factorial formula says the same thing:

    8P3 = 8! ÷ 5! = (8 × 7 × 6 × 5 × 4 × 3 × 2 × 1) ÷ (5 × 4 × 3 × 2 × 1)

    Everything from 5 down cancels, and 8 × 7 × 6 is left. The calculator’s steps show the short product, because working out 8! in full and then dividing is slower and easier to get wrong. For big inputs the shortcut matters even more. 100P3 is just 100 × 99 × 98 = 970,200, while 100! has 158 digits.

    nCr: Divide Out the Orders

    Now pick 3 toppings from 10. Counting slot by slot gives 10 × 9 × 8 = 720, but that counts every pizza more than once. Pepperoni-mushroom-olive and olive-pepperoni-mushroom were counted as different, and they’re the same pizza.

    Three toppings can be put in order in 3! = 6 ways. Every pizza appears 6 times among the 720, so:

    10C3 = 720 ÷ 6 = 120

    That is the whole link between the two: nCr = nPr ÷ r!. Whenever r is 2 or more, the combination count is smaller than the permutation count by a factor of r!. If your answer is too big by exactly 6, 24 or 120, you probably counted order where it doesn’t matter. The calculator’s tip names the factor for your numbers.

    The List every pick tab makes this visible. Type A, B, C, D, pick 2, and switch between “order matters” (12 picks: AB, BA, AC, CA, …) and “order doesn’t matter” (6 picks: AB, AC, AD, BC, BD, CD).

    Repeats Allowed: PINs and Ice-Cream Scoops

    Ordered, with repeats. Each slot can be filled by any of the n items, whatever came before, so the count is n × n × … × n = nʳ. A 4-digit PIN has 10 choices per digit: 10⁴ = 10,000 codes. A code of three numbers, each from 0 to 39, has 40³ = 64,000 possibilities.

    Unordered, with repeats. This is the hardest of the four to picture. Choosing 3 scoops from 5 flavors, with doubles allowed, gives C(n + r − 1, r) = C(7, 3) = 35.

    The trick behind it is called stars and bars. Draw each scoop as a star and use bars to split the stars into flavor groups. Five flavors need 4 bars. With the flavors in a fixed order and mint fourth, “two vanilla, one mint” looks like ★★|||★|. Every pick is just a way to arrange 3 stars and 4 bars in a row of 7, so the count is the number of ways to choose which 3 of the 7 spots hold stars: C(7, 3) = 35.

    Words With Repeated Letters

    How many different ways can you arrange the letters of MISSISSIPPI? If all 11 letters were different, the answer would be 11! = 39,916,800. But swapping the four S’s among themselves changes nothing, and the same goes for the four I’s and the two P’s. Divide those out:

    11! ÷ (4! × 4! × 2!) = 39,916,800 ÷ 1,152 = 34,650

    The general rule: n! divided by the factorial of each repeat count. BANANA has 6 letters with three A’s and two N’s: 6! ÷ (3! × 2!) = 60.

    The same works for objects. Six flags in a row, 3 red, 2 blue and 1 green, can be ordered in 6! ÷ (3! × 2! × 1!) = 60 different ways. In the Letters and repeats tab, type a word, or type the group sizes such as 3, 2, 1.

    Seats Around a Round Table

    Six people around a round table don’t give 6! = 720 different seatings. If everyone moves one seat to the left, each person has the same neighbors, so it is the same arrangement. Each seating appears 6 times among the 720.

    Fix one person in place and arrange the other five around them: (n − 1)! = 5! = 120.

    If the circle can also be flipped over, like beads on a necklace, clockwise and anticlockwise orders look the same, and the count halves to 60. Pick “in a circle” in the Letters and repeats tab with 6 different letters to see both. The circle rule here is for items that are all different. With repeated items, some rotations can land on the same pattern, and simple division no longer works.

    Card Hands and Other Big Counts

    A 5-card poker hand is a combination: you hold the same hand whatever order the cards came in. From 52 cards:

    C(52, 5) = 2,598,960 possible hands

    Counting the hands of one kind gives probabilities. Four of a kind needs one of 13 ranks for the four matching cards, then any of the 48 other cards as the fifth: 13 × 48 = 624 hands. The chance is 624 ÷ 2,598,960 = 1 in 4,165. The probability calculator takes those two counts in its one-event tab and gives the decimal, percent and odds.

    Mixed problems combine steps by multiplying them. Choosing a 3-person committee from 10 people is C(10, 3) = 120. Choosing a president, secretary and treasurer from the same 10 is 10P3 = 720, which is the 120 committees times the 3! = 6 ways to hand out the roles.

    Pascal’s Triangle and the Symmetry Shortcut

    Every combination count sits in Pascal’s triangle. Row n, position r (counting both from 0) is C(n, r), and each number is the sum of the two above it. The calculator draws the triangle for n up to 12 and highlights your answer.

    Two patterns save work:

    • Symmetry: choosing r items to keep is the same as choosing n − r to leave out, so C(n, r) = C(n, n − r). C(20, 18) looks hard but equals C(20, 2) = 190.
    • Row sums: row n adds up to 2ⁿ, because each item is either in or out. With 10 toppings and any number of them allowed, from none to all, there are 2¹⁰ = 1,024 possible pizzas.

    Edge Cases: 0!, r = 0 and r > n

    • 0! = 1. There is exactly one way to arrange nothing: do nothing. It also keeps the formulas working. 5P5 = 5! ÷ 0! has to equal 5! = 120, which needs 0! = 1.
    • r = 0. There is one way to choose nothing, so C(n, 0) = 1 and nP0 = 1 for any n.
    • r > n without repeats. You can’t pick 6 different items from 5, so nPr and nCr are both 0. The calculator says so and still shows the with-repeats counts, which make sense here: a 6-digit code from 5 symbols has 5⁶ = 15,625 options.

    Doing It in Excel or Google Sheets

    What you wantFormulaExample result
    nPr=PERMUT(8, 3)336
    nCr=COMBIN(10, 3)120
    Combinations with repeats=COMBINA(5, 3)35
    Permutations with repeats=10^410,000
    Factorial=FACT(11)39,916,800
    Repeated letters=MULTINOMIAL(4, 4, 2, 1)34,650

    MULTINOMIAL takes the repeat counts of every letter, including letters that appear once. MISSISSIPPI has M once, I four times, S four times and P twice.

    Spreadsheets switch to rounded scientific form past 15 significant digits, so a large count such as 30! loses its last digits. The calculator keeps every digit.

    How Fast These Numbers Grow

    Factorials outrun everyday intuition. 13! is already 6,227,020,800, more than 6 billion. 20! is about 2.43 × 10¹⁸.

    A shuffled deck of 52 cards can be in 52! orders, a 68-digit number of about 8.07 × 10⁶⁷. That is so large that any well-shuffled deck is almost certainly in an order no deck has been in before.

    That growth is why counting by listing stops working almost at once. The List every pick tab shows up to 500 picks, and 10P3 alone already needs 720. Beyond that point the formulas are the only practical way to count.