What the tech

Search

/ opens search from anywhere. Esc closes it.

Tools

Get the newsletter

Password Tools

PIN Generator

Generator

Random PINs for phones, cards, apps and door codes, without the codes people choose most often. Made on your own device.

 

N new   C copy

 

6 where you can, 4 where you must

The link carries your settings, never the PIN.

Make several at once

Up to 100, with these settings

Why a random PIN

PINs are guessed differently from passwords. Phones, cards and apps allow only a few wrong tries before they lock or wipe, so an attacker does not try every code: they try the codes people pick most. In an analysis of 3.4 million four-digit PINs, 1234 alone made up about 11%, and it was used more than the 4,200 least popular codes combined (DataGenetics). A random PIN is not in that short list, which is all a PIN has to do.

Which PINs we skip

With “Skip weak PINs” on, the tool throws away and redraws any PIN that:

  • is one of the most common codes, such as 1234, 0000, 1212, 6969, 123456 and 112233;
  • repeats one digit (7777) or a short pattern (1212, 123123);
  • runs up or down (3456, 98765);
  • looks like a year from 1940 to 2039, for four digits;
  • looks like a date, as MMDD or DDMM for four digits and DDMMYY, MMDDYY or YYMMDD for six.
DigitsAll PINsSkippedLeft to pick from
410,0007889,212
61,000,00086,662913,338

Skipping costs almost nothing in strength, because every PIN that is left is equally likely, and it removes exactly the codes attackers try first.

4 digits or 6?

Use 6 wherever you can. A random 4-digit PIN is one in about 9,200; a random 6-digit PIN is one in about 913,000, a hundred times harder to hit in the few tries a locked phone allows. Use 4 only where a card or lock demands it, and never reuse your card PIN for your phone.

A PIN protects a device that also stops guessing after a few tries. It is not a substitute for a password on a website, where an attacker can try codes much faster: use the password generator for those.

How the digits are picked

Every digit is picked in your browser with the Web Crypto API, crypto.getRandomValues, the same source of randomness browsers use for encryption keys. It never uses Math.random, which is not meant for secrets.

Picks use rejection sampling: a random number that would make some digits slightly more likely than others is thrown away and drawn again, so every digit is exactly as likely as the next. The strength shown is counted exactly from your settings, not guessed from how the result looks.

function rand(n) {               // a whole number from 0 to n-1, all equally likely
  const lim = Math.floor(2 ** 32 / n) * n, b = new Uint32Array(1);
  do crypto.getRandomValues(b); while (b[0] >= lim);
  return b[0] % n;
}

Test it yourself. Draw a million characters with the same method and see whether any comes up more often than it should.

Nothing leaves the page: there is no server step, no log and no cookie for this tool. Your settings stay in this browser so the tool opens the way you left it; what you make is never stored. Load the page, turn off Wi-Fi, and it keeps working.

Questions

What are the worst PINs to use?

1234, 1111, 0000, 1212 and 7777 top every list, followed by years of birth and dates such as 0101 or 1225. Any PIN that means something to you is in someone's list.

Is a random PIN harder to remember?

For a day or two. Say it in two halves (“forty-seven, eighty-three”) and type it a few times; muscle memory does the rest. Keep it in your password manager meanwhile.

Can I make PINs for many people at once?

Yes. “Make several at once” makes up to 100 different random PINs with the same settings, ready to copy or download as a text file, for example for door codes or new staff cards.

Sources: DataGenetics PIN analysis. Checked November 7, 2026.