PIN Generator

Choose the length and get a random PIN, with a note when it happens to look like a year, a date or a pattern people try first. Made on this device; nothing is sent or kept.

How it works

Each digit is drawn separately with crypto.getRandomValues, the browser's secure random source, and every digit from 0 to 9 is equally likely. Draws that would favour low digits are thrown away and repeated.

The finished PIN is then checked against the patterns guessers try first: one digit repeated, digits counting up or down, a repeated block such as 1212, one of the 20 most common 4-digit PINs, a year from 1900 to 2029, and a day and month.

A PIN that matches is pointed out, never silently replaced. It is exactly as likely as any other PIN, and quietly skipping some would make the PINs this page shows less random, not more. Whether to draw again is your choice.

How to use it

  1. 1 Choose the length: 4, 6 or 8 digits, or Other length for anything from 3 to 12.
  2. 2 Read the PIN and the line under it. It says how many PINs were possible.
  3. 3 If a note says the PIN looks like a date, a year or a pattern, press New PIN for another.
  4. 4 Set the PIN on your card, phone or lock, then close the page.

Good to know

  • Use the longest PIN the device allows. Each extra digit makes guessing ten times harder.
  • Do not use the same PIN for your bank card and your phone. If someone sees you type one, they have both.
  • Never base a PIN on a birthday, an anniversary or a year. Those are the first guesses of anyone who knows you.
  • Cover the keypad when you type it. A random PIN does not help against someone watching.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Random PINs, and the ones a guesser tries first

A 4-digit PIN has 10,000 possible values, 0000 to 9999. That sounds small, and for a password it would be, but a PIN is protected differently. A bank card swallows itself after three wrong tries and a phone slows down or wipes itself after ten. Against a guesser with three tries, a truly random 4-digit PIN gives odds of 3 in 10,000. The trouble is that people do not choose PINs at random, and guessers know it.

In 2012 the data blog DataGenetics studied 3.4 million 4-digit PINs from leaked lists. The single most common, 1234, was about one PIN in nine. The top 20, a list that includes 1111, 0000, 1212, 7777, 2000 and 4321, covered more than a quarter of everyone. Years were common, especially the 1900s, and so were dates written as day and month or month and day. A guesser with three tries starts with those, and their odds are far better than 3 in 10,000.

This page draws each digit with crypto.getRandomValues, the browser's secure random source, so every PIN of the chosen length is equally likely. It then checks the result against the patterns that guessers try first: one digit repeated, a run counting up or down, a repeated block such as 1212 or 123123, one of the top 20 from that study, a year from 1900 to 2029, and a valid day and month in either order. If the PIN matches any of them, the note under it says which and suggests a second draw.

The page never drops such a PIN on its own. That may seem backwards, but a random 1990 is exactly as random as a random 5830. The danger is not in the number; it is that a guesser will try 1990 early. If a generator silently skipped every PIN that looked like a year, the PINs it showed would come from a smaller set, and that smaller set would be a little easier to guess. Telling you, and leaving the choice to you, keeps the draw honest.

Length matters more than anything else. A 6-digit PIN has a million possible values and an 8-digit one a hundred million, so use the longest the device allows. Many phones accept 6 digits or more, and some locks accept up to 12. The Other length option covers anything from 3 to 12 digits.

The PIN is made in this page and is not sent anywhere. Set it, then close the tab. And cover the keypad when you use it: a random PIN protects against guessing, not against someone watching over your shoulder.

Frequently asked questions

Is a random 4-digit PIN safe?

For a bank card or a phone that locks after a few wrong tries, yes. There are 10,000 possible PINs and only a handful of tries. The risk is a PIN people guess first, such as 1234 or a birth year, which is why the page points those out.

Why does the page not just skip PINs like 1111?

A random 1111 is as likely as any other PIN. Skipping it would make the remaining PINs a little more predictable. So the page tells you, and you decide whether to draw again.

Which PINs are the most common?

In an analysis of 3.4 million leaked 4-digit PINs published by DataGenetics in 2012, 1234, 1111, 0000, 1212 and 7777 led the list, and the top 20 made up more than a quarter of all of them. This page flags all 20.

Is the PIN sent anywhere?

No. It is made in this page with your browser's secure random generator and is not sent to YappyKit or anyone else.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.