Random PIN Generator

–codes on screen only - nothing stored, nothing sent
–batch size
–arrangements in the space
–source: crypto.getRandomValues
No-repeat mode trades a little entropy (10 x 9 x 8 x 7 = 5,040 arrangements for 4 digits) to remove the wear, smudge and timing patterns repeated digits leave on shared keypads. A PIN protects the thing in your hand - the account behind a rate-limited lock; long secrets belong to the NIST SP 800-63B memorized-secret rules, which is what this page's guidance follows.
Chance and secrets next door: the password generator for the long-secret jobs, the random number generator for bare ranges, and the coin flip for two-way calls.
PIN lengthCombinationsRealistic margin
4 digits10,000ATM legacy - fine with a locked card, thin elsewhere
6 digits1,000,000The modern phone floor - 100x the 4-digit space
8 digits100,000,000Rate limits make brute force impractical
The combinations column is arithmetic (10 to the power of length); what protects a PIN in practice is rate limiting and lockout on the verifier side - which is also why birthday-and-1234 patterns beat length as the real-world weak point. Avoid repeated digits, sequences, and any year you would also put on a cake.

A PIN is a knowledge-based lock: four digits give ten thousand combinations, six give a million, and the only thing that makes either safe is that the digits are genuinely unpredictable and nobody watches them get typed. This generator uses the browser's cryptographic random source (the same primitive behind the site's coin flip), never reuses a digit across a code unless you ask for that mode, and shows the codes on screen only.

The honest framing comes from NIST's digital identity guidelines, which treat a PIN as a memorized secret: short numeric codes are acceptable where the system rate-limits guesses and the PIN unlocks something already in your hand - a phone, a card, a door - not where it is the only thing standing between the internet and an account. That is why there is no 12-digit mode here: a credential that long has stopped being a PIN and should be a password or a passphrase.

How to use

  1. Pick the digit count and how many PINs you need - a fresh batch appears instantly, generated in your browser.
  2. Use no-repeat mode for codes typed on shared keypads (ATMs, door pads), where repeated digits leak timing and smudge clues.
  3. Generate, then use it once and let it be forgotten - a PIN you never write down and never reuse is doing its whole job.

Worked examples

The 10,000-door problem

A 4-digit PIN lives in a space of 10,000 combinations (0000 to 9999). Against an online system that locks after a handful of tries, that is safe; against a stolen card with unlimited offline attempts, 10,000 tries is minutes - which is the whole argument for 6 digits (a million doors) on anything that leaves your pocket.

Why 1234 is the worst and what replaces it

The famous leaked-PIN analyses keep finding the same tail: 1234, 1111, 0000 and birth years cover a startling share of real PINs, because humans pick dates and patterns. A uniform draw from the full 10,000 (this generator) gives every combination an equal 1-in-10,000 shot - which makes your PIN exactly as guessable as any other, i.e. not guessable at all.

The shared-PIN check

In a five-person household sharing a door code format, the chance any two picked the same 4-digit PIN is only about 0.1 percent (the birthday paradox over 10,000 slots) - collisions are rare, which is why shared-keypads work at all. The rare collision is also why changing a code when someone moves out matters more than the odds suggest.

Frequently asked questions

Is a 4-digit PIN safe?

For unlocking a device that rate-limits guesses and erases after ten tries - yes, that is the arrangement NIST's guidance accepts for memorized secrets: the lock's throttling does the protecting, not the number's entropy. Ten thousand combinations fall in hours against a system that allows unlimited fast guesses, so a 4-digit PIN guarding such a system is the wrong tool; use 6+ digits or a password there.

Why avoid repeated digits?

Two reasons, both physical rather than mathematical: wear and smudge on a keypad narrow which keys were pressed, and repeated digits create timing patterns. The no-repeat mode keeps all digits distinct - it sacrifices a little entropy (5,040 arrangements instead of 10,000) to remove the observable patterns that matter on shared pads.

What makes these PINs random?

They come from crypto.getRandomValues, the browser's cryptographic random generator seeded by the operating system - the same primitive behind this site's coin flip and shuffles. No seed table, no 'random' from the clock, and nothing is transmitted or stored: reload the page and the codes are gone forever.

Should I use a PIN or a password?

Match the secret to the lock. A PIN protects a thing you physically hold and type near - phones, cards, door pads, SIM trays - where a short numeric secret typed daily beats a long one nobody types correctly. Accounts reached from anywhere on the internet need the opposite: a long generated password, ideally behind a manager, because a numeric PIN there is guesswork waiting to happen.

How many PINs should I keep?

One per device, and distinct between the ones you carry together. Reusing one PIN across a phone, a card and a gym locker turns any one of them into a master key for all three - the same reuse problem passwords have, minus the length that would otherwise save you.

Related tools