Random PIN Generator

This random PIN generator picks each digit with your browser’s cryptographic random number generator. Choose a length from 3 to 12 digits, optionally skip easy patterns such as 1111, 1234 and birth-year lookalikes, then copy the result. A PIN made here is never sent anywhere or saved.

Generate a random PIN

Skipping easy patterns removes only a small share of the possibilities, so strength barely changes.

    Length–
    Possible PINs–
    Entropy–

    Everything runs in your browser. Nothing you type is sent anywhere or logged.

    How to use it

    1. Set the length. Use the longest PIN the device or card allows; a six-digit PIN has a hundred times as many possibilities as a four-digit one.
    2. Leave “Skip easy patterns” ticked unless you have a reason not to. It stops the generator from returning things like 0000 or 1234.
    3. Tick “No repeated digits” only if a system rejects repeats. It shrinks the number of possibilities a little.
    4. Press Generate, copy the PIN or memorise it, and set it on your device. Never type a PIN you actually use into a website, including this one: for your own safety, use this tool to create it, then enter it only on the device or app that asks for it.

    When to use it

    • A phone or tablet lock-screen PIN that is not a birthday, a repeat or a simple run of digits.
    • A bank card or SIM PIN, where your provider lets you choose it.
    • A door-lock, safe or locker code that you change for each guest or each season.
    • Checking how many different PINs are possible at a given length, before deciding how long yours should be.

    How the PIN is chosen

    Each digit is drawn independently from 0 to 9 using the browser’s cryptographic random number generator. The generator avoids the small bias that comes from the common shortcut of taking a random number modulo 10, by discarding values that would favour some digits. Every PIN of the chosen length is therefore equally likely.

    When “Skip easy patterns” is on, a PIN that matches one of the patterns below is thrown away and a new one is drawn, which keeps the remaining PINs equally likely too. The patterns are: a block repeated through the whole PIN (1111, 1212, 123123), a straight run up or down (1234, 6543), and, for four digits, any number from 1900 to 2029, because many people choose a birth year. With “No repeated digits” on, the digits are picked by shuffling, so every ordered selection of different digits is equally likely.

    Worked example. A four-digit PIN has 10 × 10 × 10 × 10 = 10,000 possibilities. If a card locks after three wrong tries, a blind guess succeeds with a probability of 3 in 10,000, or 0.03%. A six-digit PIN has 1,000,000 possibilities, so the same three tries succeed with a probability of 0.0003%. The easy-pattern filter removes 242 four-digit PINs, which leaves 9,758 and costs about 0.04 bits.

    Why random matters more than length alone

    People choose PINs in predictable ways: birth years, repeated digits, simple runs and keypad shapes. Studies of leaked PINs find that a handful of such choices make up a large share of all PINs in use, so a guesser who tries the common ones first is far more likely to succeed than the plain arithmetic suggests. A random PIN does not follow any of those habits.

    A PIN is only as strong as the lockout behind it

    A PIN has few possibilities, so it is safe only where the device or service limits wrong guesses, as phones, cards and ATMs do. If a PIN is the only thing protecting an online account with no limit on attempts, use a long password or passphrase instead.

    How PIN length changes the odds of a blind guess
    PIN lengthPossible PINsEntropyChance a blind guess works in 3 tries
    4 digits10,00013.3 bits0.03%
    5 digits100,00016.6 bits0.003%
    6 digits1,000,00019.9 bits0.0003%
    8 digits100,000,00026.6 bits0.000003%

    Frequently asked questions

    How many digits should a PIN have?

    As many as the device or card allows. Six digits give a hundred times as many possibilities as four, and eight give ten thousand times as many. If the system locks after a few wrong tries, even four random digits resist guessing well.

    Is a random PIN safer than one I choose?

    Yes. People tend to choose birthdays, repeats and simple runs, and guessers try those first. A random PIN avoids such patterns, though you will have to memorise it.

    Does skipping easy patterns make my PIN weaker?

    Very slightly. For four digits it removes 242 of the 10,000 possibilities. Because those are the ones guessers try first, the PIN you get is harder to guess in practice than an average PIN.

    Is the PIN saved or sent anywhere?

    No. It is made in your browser, shown on this page and discarded when you leave. Nothing is transmitted to us or stored.

    Should I use the same PIN for my phone and my bank card?

    No. If one is seen or leaked, the other is at risk. Use a different random PIN for each, and do not write it on the card or keep it in the same wallet.

    Can a PIN be hacked?

    It can be guessed if the system allows unlimited tries, or if the PIN is a common one. Lockouts and rate limits are what protect short PINs, so choose the longest PIN allowed and keep it random.

    Sources and further reading