Skip to main content

Permutations with Repetition Calculator

Calculate n^r — how many ordered arrangements of r positions are possible when choosing from n items and repetition is allowed (PIN codes, lock combinations, passwords) — with exact results for large n and r using arbitrary-precision arithmetic.

Input

r may exceed n — repetition means positions aren't limited by how many items exist.

Output

Result
MetricValue
No data yet
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/permutations-with-repetition-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "n": "10",
    "r": "4"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `permutations-with-repetition-calculator` tool (Permutations with Repetition Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/permutations-with-repetition-calculator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Permutations with Repetition Calculator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

The Permutations with Repetition Calculator works out how many ordered arrangements are possible when you fill r positions by choosing from n items, and repeats are allowed at every position — a 4-digit PIN, a 3-letter lock code, a password drawn from a fixed alphabet. Enter both numbers and the tool instantly returns n^r, along with the no-repetition permutation and combination counts for comparison, all computed exactly even for large values.

What makes this different from a plain permutation?

An ordinary permutation (no repetition) picks each item once — after you use the digit 7, it's gone from the pool for the next position. Here, every position independently draws from the full set of n items again, so the same item can appear more than once in the result (a PIN of 7777 is a valid, distinct arrangement).

That's why the formula is simply n^r: each of the r positions has n independent choices, so the counts multiply. Unlike the no-repetition case, r is not limited by n — a 5-character password drawn from just 2 symbols is a perfectly valid (and non-zero) count, since positions can repeat.

How to use the calculator

  1. Enter n, the number of distinct items you're choosing from (10 digits, 26 letters, 2 symbols, etc.).
  2. Enter r, the number of positions to fill.
  3. The results table updates automatically, showing the arrangement count n^r, its digit length, and the matching no-repetition permutation P(n, r) and combination C(n, r) counts for comparison.

The formula

Arrangements with repetition = n^r

Where n is the pool size and r is the number of positions filled. By convention, n^0 = 1 for any n (there's exactly one way to fill zero positions — do nothing), and 0^r = 0 for r > 0 (you can't fill any position with zero available items).

Reading the comparison rows

The table also shows P(n, r) and C(n, r) — the no-repetition permutation and combination counts — so you can see how much repetition inflates the result. Both fall to 0 whenever r exceeds n, since you can't arrange or choose more distinct items than exist without repeating one. The combinations with repetition row (the multiset formula, C(n + r − 1, r)) is included too, for the unordered-with-repetition case (how many distinct multisets of size r you could draw from n kinds, ignoring order).

When would I use this instead of a plain permutation calculator?

Whenever positions can genuinely repeat — a PIN, a coupon or lock code, a dice-roll sequence, DNA base sequences (4 bases, any length). If each item can only be used once (drawing cards without replacement, ranking distinct racers), use the Permutation & Combination Calculator instead.

Does this run in my browser?

Yes — all calculations happen locally in your browser (or via the API if you call it that way). No data about your n and r values is sent anywhere beyond what's needed to load the page.

permutation with repetitionn to the power of rn^rpin code combinationslock combinationpassword combinationscombinatoricsordered arrangementsprobability

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.