RunTheTests
/

PIN Generator

Generate a random PIN, digits only.

Settings

Generated with WebCrypto in your browser. No network request is made.

How this works

Each digit is drawn with crypto.getRandomValues using rejection sampling, so every digit is equally likely. Adjust the length for a 4, 6 or longer PIN.

What the results mean

Length matters most
A 4-digit PIN is one of 10,000; a 6-digit is one of a million. Longer is exponentially harder to guess.
No excluded patterns
Every combination is equally likely, including 1234 and 0000. Excluding them would shrink the space and make the result marginally more predictable, not less.

Common problems and fixes

It generated something like 1111 or 1234
That is randomness behaving correctly — every four-digit combination has the same one-in-ten-thousand chance, including the memorable ones. Generate another if it makes you uncomfortable, but understand that a generator which filters out "bad-looking" PINs has made the remaining set smaller and slightly easier to guess.
The system will not accept the PIN
Some systems reject sequences, repeats or PINs matching part of your account details, and a few require a specific length. Generate another at the required length. If a system also forbids a PIN you can remember, that is a sign it is relying on the PIN for more security than a PIN can provide.
I need something stronger than a PIN
Then use a password. A six-digit PIN is one of a million combinations, which a computer exhausts instantly — its security comes almost entirely from the device limiting attempts and locking after a few failures. Anywhere that protection does not exist, digits alone are the wrong choice.

Frequently asked questions

Is a PIN as secure as a password?

No, and it is not meant to be. A PIN’s security comes largely from the device limiting guesses and locking after a few tries, not from the PIN itself. For anything protected by guessing alone, use a full password, which has vastly more entropy.

Are four digits enough?

Only when something limits the guesses. A phone that locks after ten attempts makes a four-digit PIN reasonable; a system that allows unlimited tries makes it worthless, since ten thousand combinations take no time at all. Six digits is a hundred times better and still trivial without rate limiting — the lockout is the real protection.

Should I avoid using a date?

Yes, particularly a birthday or an anniversary. Analyses of leaked PIN sets show dates dominate the most common choices, which is why attackers try them first, and yours is often discoverable. A random PIN of the same length is enormously harder to guess for exactly the same amount of typing.

Put this on your own site

Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.

Embed code
<iframe src="https://runthetests.com/embed/pin-generator/" width="100%" height="560" style="border:1px solid #e5e5e5;border-radius:8px" title="PIN Generator" loading="lazy"></iframe>

Preview it at https://runthetests.com/embed/pin-generator/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.

More in Security