Permutations with Replacement Calculator tool

Permutations with Replacement Calculator

Permutations with replacement count ordered strings when the same symbol can appear more than once.

What is a permutations with replacement calculator?

A permutations with replacement calculator counts ordered strings of length r when each position can use any of n symbols again. The count is n^r because you have n choices at every slot. PIN codes and repeated dice rolls follow this rule when order matters and reuse is allowed. Enter n and r to get the total.

How to use the Permutations with Replacement Calculator

  1. Enter n, the number of distinct choices per slot.
  2. Enter r, how many ordered positions you fill.
  3. Read n^r as the total arrangement count.
  4. Use the result for PIN, password, or dice problems.
  5. Compare with plain permutations when reuse is not allowed.

About this calculator

Permutations with replacement count ordered strings when the same symbol can appear more than once. Multiply n by itself r times: n^r.

A bike lock with 4 dials and 10 digits per dial has 10^4 = 10,000 settings. Rolling two dice and caring about order gives 6^2 = 36 outcomes.

Enter n and r to get the count. For unordered picks with repetition use [[combinations-with-replacement]]. For no repetition use [[permutation-combination]]. For exponents generally see [[exponent]].

Formula for permutations with replacement

Ordered with replacement: n^r
Each of r slots has n independent choices
  • n is the number of distinct symbols or digits available
  • r is the length of the ordered string
  • n^r counts every ordered sequence with reuse allowed

Permutations with replacement example: 4-digit PIN

How many 4-digit PINs use digits 0 through 9 if digits may repeat? Here n = 10 and r = 4. Each of the four slots has 10 choices, so the total is 10^4 = 10,000.

Enter n = 10 and r = 4. The calculator should show 10,000. A smaller case: three coin flips with order kept. n = 2 (H or T) and r = 3, giving 2^3 = 8 strings such as HHT and TTT. Without replacement, you could not reuse the same coin outcome in one string, so the plain permutation formula would apply instead. Replacement means the same digit or face can appear in multiple positions.

License plates that allow repeated letters follow n^r with n equal to the alphabet size plus digits if both are allowed. A die rolled three times has n equals 6 and r equals 3, giving 6^3 equals 216 ordered outcomes. A four-letter password from 26 letters without reuse would not use this formula; it would use permutations without replacement instead. Binary strings of length 8 for bytes use n equals 2 and r equals 8, giving 256 patterns, which is why one byte stores eight independent bit choices. Order matters in strings, so ABC and CBA count as different outcomes. Typing n and r on the page should reproduce the power count shown in this example.

Common uses

  • Count possible 4-digit PINs from 10 digits
  • Estimate password space with repeated characters allowed
  • Solve dice-and-slot counting problems
  • Compare ordered vs unordered repetition counts

Frequently asked questions

What is 10^4 for a PIN?

10,000. Each of 4 positions has 10 digit choices, so 10 × 10 × 10 × 10 = 10^4.

How is n^r different from P(n,r)?

P(n,r) = n!/(n−r)! forbids repeats and needs r ≤ n. n^r allows repeats and works when r > n.

What is 6^2 for two dice rolls?

36 ordered outcomes. Each roll has 6 faces, and (3,5) differs from (5,3) when order matters.

When does n^r overflow?

JavaScript doubles cap around 10^308. Very large n and r may show scientific notation or

Related calculators

Maintained by J Jaya Prakash · Last updated: October 2026