Permutations with Repetition Calculator

Count ordered arrangements when repetition is allowed

How it is calculated

The tool computes nr. n is the number of different symbols you can pick from (for example 10 digits, or 26 letters) and r is how many positions are filled. Each position is chosen independently and the same symbol may repeat, so the choices multiply: n × n × … × n, r times.

Both inputs must be whole numbers; a decimal such as 5.9 gives no result. n must be at least 1 and r at least 0; with r = 0 the answer is 1, the single empty arrangement. The count is shown with exact digits up to 100 digits (6212 = 3,226,266,762,397,899,821,056); beyond that it is a rounded form such as ≈ 1.15 × 10^602 (for 22000). Order matters here, so AB and BA are counted separately.

Worked example

A password has 8 characters, each a letter in upper or lower case or a digit: 26 + 26 + 10 = 62 symbols. So n = 62 and r = 8. The count is 62 × 62 × … (8 times) = 218,340,105,584,896, roughly 2.2×1014 possible passwords. By comparison, a 4-digit PIN (n = 10, r = 4) has only 10,000.

Try this example →

Common mistakes

  • Using the formula for no repetition (n!/(n−r)!) when characters may repeat. Passwords and PINs allow repeats, so the correct count is nr.
  • Swapping n and r. 104 = 10,000 but 410 = 1,048,576; n is the symbol set size and r is the length.
  • Counting the symbol set wrongly, for example forgetting that upper and lower case letters are different symbols.
  • Entering decimals. n and r must be whole numbers, so 62.9 gives no result.
  • Treating the total as the expected number of guesses. An attacker needs on average about half of the possibilities, and only when the choice is truly random.

About this calculator

When order matters and repeated choices are allowed, the count of possible arrangements of length r drawn from n items is simply n^r — each of the r positions independently has n options, so the counts multiply. This is different from permutations without repetition (n!/(n−r)!), where each item can only be used once.

It's the exact math behind a 4-digit PIN (10^4 = 10,000 combinations), a password built from a fixed character set, or a padlock with multiple dials — anywhere the same symbol can be reused in different positions. Security analysts use n^r directly to estimate how many attempts a brute-force attack would need against a given PIN or password length.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    When a code has separate segments, multiply the segment counts instead of forcing one n and r. A plate with 3 letters then 4 digits has 26³ × 10⁴ = 175,760,000 possibilities; the tool handles each segment as its own run. Counts are shown with every digit up to 100 digits, and beyond that as a rounded power of ten, so you can compare very large spaces. What kind of arrangement are you counting?

Popular calculators

All Calculators