Permutation Calculator (nPr), With and Without Repeats

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free permutation calculator. Find nPr, the number of ordered arrangements of r items from n, with or without repetition, and compare with combinations.

With repetition (nʳ)
0
Combinations (nCr)
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the permutation calculator

  1. Enter n, the total number of items to choose from.
  2. Enter r, the number of items you're choosing and arranging.
  3. Read the results. The permutation calculator shows nPr (arrangements without repetition), nʳ (arrangements when items can repeat), and nCr (combinations, where order doesn't matter) for comparison.

It calculates exactly with whole numbers up to 1,000, even when the answer has hundreds of digits. Very long answers are shortened, with the number of digits shown.

What is a permutation?

A permutation is an arrangement of items where order matters. Choosing a president, vice-president and treasurer from a club of 10 people is a permutation problem: Alice as president and Bob as vice-president is different from Bob as president and Alice as vice-president.

If order doesn't matter, such as choosing any 3 people for a committee, it's a combination instead.

The permutation formula

The number of permutations of r items chosen from n distinct items, without repetition, is:

nPr = n! ÷ (n − r)!

where n! ("n factorial") is n × (n − 1) × (n − 2) × … × 1.

For 10 people choosing 3 officers: 10P3 = 10! ÷ 7! = 10 × 9 × 8 = 720.

You can think of it step by step: there are 10 choices for president, then 9 left for vice-president, then 8 for treasurer. Multiply them: 720.

Permutations with repetition

If items can be used more than once, each of the r positions has n choices:

Permutations with repetition = nʳ

A 4-digit PIN using digits 0 to 9 has 10⁴ = 10,000 possibilities, because digits can repeat.

Arranging all the items

If you arrange all n items (r = n), nPn = n!. Five books on a shelf can be arranged in 5! = 120 ways.

Permutations versus combinations

Order matters? Formula 10 items, choose 3
Permutation Yes n! ÷ (n − r)! 720
Combination No n! ÷ (r! × (n − r)!) 120

The combination count is the permutation count divided by r!, because each group of r items can be arranged in r! orders. 720 ÷ 3! = 720 ÷ 6 = 120. Our combination calculator focuses on combinations.

A useful way to decide: ask "would swapping two chosen items give a different result?" If yes, use permutations.

Permutation examples

Race positions

Eight runners in a race: how many ways can gold, silver and bronze be awarded? 8P3 = 8 × 7 × 6 = 336.

Passwords and codes

How many 6-character codes can be made from 26 lowercase letters if letters can repeat? 26⁶ = 308,915,776. If letters can't repeat, 26P6 = 165,765,600. Our password strength checker shows why longer passwords with more character types are stronger.

Seating arrangements

How many ways can 6 guests sit in 6 chairs in a row? 6! = 720.

Licence plates

A plate with 3 letters followed by 3 digits (with repetition allowed): 26³ × 10³ = 17,576,000.

Words from letters

How many different 3-letter arrangements can be made from the letters of "SPRING" (all different)? 6P3 = 6 × 5 × 4 = 120.

Permutations with identical items

If some items are identical, swapping them doesn't create a new arrangement. The number of distinct arrangements of n items where one item appears a times, another b times, and so on, is:

n! ÷ (a! × b! × …)

The letters of "LETTER" (6 letters, with E twice and T twice) can be arranged in 6! ÷ (2! × 2!) = 720 ÷ 4 = 180 distinct ways. The permutation calculator assumes all items are distinct, so use this formula for repeated items. The factorial calculator gives the factorials.

Circular permutations

Arranging n people around a round table, where rotations count as the same arrangement, gives (n − 1)! arrangements. Six people around a table: 5! = 120.

How fast permutations grow

Permutations grow very quickly:

  • 10P5 = 30,240
  • 20P5 = 1,860,480
  • 52P5 = 311,875,200 (ordered 5-card hands from a deck)
  • 52! ≈ 8.07 × 10⁶⁷ (all orderings of a deck of cards)

52! is so large that any well-shuffled deck is almost certainly in an order that has never existed before. This rapid growth is why brute-force searching through all arrangements becomes impossible for large problems.

Permutations and probability

Permutations help work out probabilities. If 8 runners are equally likely to finish in any order, the chance of correctly guessing the top 3 in order is 1 ÷ 336 ≈ 0.30%. Our probability calculator helps with more probability questions.

A worked example

Jordan runs a café and is designing a "pick your trio" tasting menu, where customers choose 3 of 12 cakes and receive them in a chosen order (starter, middle, finale).

In the permutation calculator, n = 12 and r = 3 gives 12P3 = 1,320 ordered trios. If order didn't matter, it would be 12C3 = 220 different trios. If customers could pick the same cake more than once, there would be 12³ = 1,728 ordered options. Jordan uses "1,320 ways to build your trio" in the menu's promotional post.

Who uses a permutation calculator

Students use it for maths and statistics homework. Teachers use it to create and check problems. Programmers and security professionals use it to estimate search spaces and password strength. Event planners, sports organisers and game designers use it to count possible arrangements.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit is a Google Ads agency that does PPC and nothing else: we build the campaigns, block the searches that waste money, write the ads, set up conversion tracking and send you a short report every week. Request a free PPC audit and we will show you, in dollars, what we would fix first.

Permutation table

Values of nPr for small n and r:

n \ r 1 2 3 4 5
3 3 6 6 – –
4 4 12 24 24 –
5 5 20 60 120 120
6 6 30 120 360 720
7 7 42 210 840 2,520
8 8 56 336 1,680 6,720
10 10 90 720 5,040 30,240

Notice that nPn and nP(n−1) are always equal: once you've placed all but one item, the last one has only one place to go.

Permutations in a spreadsheet

Excel and Google Sheets have built-in functions:

  • =PERMUT(n, r) for permutations without repetition.
  • =PERMUTATIONA(n, r) for permutations with repetition (nʳ).
  • =COMBIN(n, r) for combinations.
  • =FACT(n) for factorials.

Spreadsheets use floating-point numbers, so very large results lose precision. The permutation calculator uses exact whole-number arithmetic, so even answers with hundreds of digits are exact.

How to tell which formula to use

Ask two questions:

  1. Does order matter? If yes, it's a permutation; if no, a combination.
  2. Can items repeat? If yes, use nʳ (permutations) or the combinations-with-repetition formula; if no, use nPr or nCr.
No repetition With repetition
Order matters nPr = n! ÷ (n − r)! nʳ
Order doesn't matter nCr = n! ÷ (r! (n − r)!) (n + r − 1)! ÷ (r! (n − 1)!)

For example, choosing 3 scoops from 10 ice cream flavours, where you can repeat flavours and the order in the bowl doesn't matter, is a combination with repetition: 12! ÷ (3! × 9!) = 220.

Permutations in security

Security experts use permutations to estimate how hard a password or code is to guess. The number of possible passwords is nʳ when characters can repeat (as they usually can), where n is the number of possible characters and r the length. An 8-character password using 26 lowercase letters has 26⁸ ≈ 209 billion possibilities; using upper and lower case letters, digits and 10 symbols (72 characters), it has 72⁸ ≈ 722 trillion. Adding length helps even more than adding character types, because the length is the exponent.

Permutations in everyday decisions

Permutations show up in more places than you might expect:

  • Scheduling: the number of ways to order 6 meetings in a day is 6! = 720.
  • Menus and bundles: the number of ways to choose and order a starter, main and dessert from a menu combines permutations and the multiplication principle.
  • Sport: the number of possible finishing orders for the top places in a league or race.
  • Testing: software testers use permutations to work out how many orders of steps or inputs might need checking.
  • Games and puzzles: the number of arrangements of tiles, cards or pieces.

Because permutations grow so fast, real-world problems often become too large to check every possibility. That's why the permutation calculator shows exact values even when they run to hundreds of digits: it tells you quickly whether trying every arrangement is realistic or whether you need a smarter approach.

Sources and further reading

  • Permutation on Wikipedia: definitions, formulas and properties.
  • Combination on Wikipedia: selections where order doesn't matter.
  • Factorial on Wikipedia: the factorial function used in both formulas.

Frequently asked questions

What is the formula for permutations?

nPr = n! ÷ (n − r)!. With repetition allowed, it's nʳ.

What is the difference between a permutation and a combination?

In a permutation, order matters. In a combination, it doesn't. nCr = nPr ÷ r!.

How many permutations of 3 items from 5 are there?

5P3 = 5 × 4 × 3 = 60.

How many ways can 5 people be arranged in a line?

5! = 120.

What if r is larger than n?

Without repetition, there are no arrangements (0). With repetition, there are nʳ.

Is the permutation calculator free?

Yes. It's free, needs no sign-up, and works in your browser.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep