InfyCalculator
📊

Combination Lock Permutations Calculator

Count how many codes a lock or PIN has from the symbols per position and length, with and without repeated symbols — plus brute-force time.

Symbols per position
Number of positions (length)
Repeated symbols allowed?
Guesses per second
Loading calculator…

How it works

With repeats: codes = symbols^length · Without repeats: codes = symbols · (symbols−1) · … · (symbols−length+1)

When each dial can show any symbol independently, the total number of codes is symbols raised to the power of the length — every added position multiplies the count. If symbols cannot repeat (each used at most once), it becomes a falling-factorial permutation instead, which is smaller. Note that a "combination" lock is really a permutation device: order matters, so 1-2-3 differs from 3-2-1.

Worked example

A 4-digit PIN uses 10 symbols (0–9) across 4 positions with repeats allowed: 10⁴ = 10,000 codes, so a single guess has a 1 in 10,000 chance. Forbid repeats and it drops to 10 × 9 × 8 × 7 = 5,040 codes.

Sources: Permutation — Wikipedia

Frequently asked questions

Is a padlock really a permutation, not a combination?

Yes. Mathematically a "combination" ignores order, but a lock cares about order — 3-1-2 opens nothing if the code is 1-2-3. So the correct count is a permutation (with repeats, symbols^length), despite the everyday name.

How much does adding one more digit help?

Enormously. Each extra position multiplies the total by the number of symbols. A 4-digit PIN has 10,000 codes; a 6-digit PIN has 1,000,000 — a hundredfold jump for two more digits.

What does the brute-force time assume?

It assumes an attacker tries codes at your stated guesses-per-second rate with no lockout. Real devices add delays or lock after a few failures, so practical security is far higher than the raw time suggests.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.