Calculators Ordered lock codes with repeats

Four Dial Lock Combination Calculator

How many combinations can you make on a lock with four dials? Customize your dial range or symbols depending on your lock. Lock users call these combinations, but mathematically they are in the permutation-with-repetition family because order matters and repeated symbols are allowed.

Number of dials / positions
4
We are given a fixed number of dials or spins.

Result

0

Enter values to calculate.

What your result means

The explanation updates with the current inputs.

Calculation work

    Live visual

    Lock preview

    Calculators Ordered lock codes with repeats

    Count possible codes for a four-dial lock when each dial can reuse any allowed symbol.

    When to use this

    Use this formula when the question matches this rule set

    Use this for 4-dial bike locks, luggage locks, letter locks, or any four-position code where each dial can show one value from the same shared pool.

    What this result means

    Interpret the output, not just the number

    The result is the total number of different codes the lock can show. Because 1234 and 4321 are different codes, order matters. Because 0000 is usually allowed, repeats are allowed too, so the count uses n^r.

    Formula: n^r

    Calculator inputs

    Know what to enter in each field

    These pages use lock language, but the math is permutation with repetition: order matters, repeats are allowed, and the count is n^r.

    Number of dials / positions

    This is how many ordered slots the code uses.

    What to enter: On the dedicated lock pages this value is preset by the page title.

    How to use it: Each extra dial multiplies the total again because a code like 1234 is different from 4321.

    Example: A three-dial lock uses 3 positions, and a four-dial lock uses 4.

    Pool type

    Choose whether each dial uses a generated range or a custom symbol list.

    What to enter: Pick Range for numeric spans like 0-9 or 0-59, or Custom list for tokens like A,B,C,D.

    How to use it: The calculator counts how many allowed symbols each dial can show, then raises that pool size to the number of positions.

    Example: A lock labeled 0-59 uses Range. A puzzle lock with A,B,C,D uses Custom list.

    Range start / range end

    These define the first and last values available on every dial when using Range.

    What to enter: Enter the full inclusive range used on each dial.

    How to use it: The pool size is end - start + 1, so 0-9 gives 10 symbols and 0-59 gives 60 symbols.

    Example: A three-number locker dial usually uses 0 through 59.

    Custom symbol list

    This defines the allowed symbols directly when the dials are not a simple numeric range.

    What to enter: Enter comma-separated tokens such as A,B,C,D or 10,20,30,59.

    How to use it: Each unique trimmed token becomes one available dial symbol. Duplicates and empty entries should be removed before solving.

    Example: A letter lock using A,B,C,D,E has 5 possible symbols on each dial.

    Worked examples

    Quick checks with realistic inputs

    Typical 0-9 bike lock

    A four-dial lock where each dial shows one digit from 0 through 9. That's 10 choices.

    A 4-position lock code with 10 options per position has 10,000 possible codes.

    Load this example into the calculator

    Letter lock with four symbols

    A four-dial letter lock where each dial can show A, B, C, or D.

    A 4-position lock code with 4 options per position has 256 possible codes.

    Load this example into the calculator