Permutations with Replacement Calculator

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

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]].

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