Free tool
Random PIN generator
Get a random PIN of 4 to 12 digits that skips the PINs people guess first: 1234, 0000, 2580, repeats, runs, keypad shapes, years and dates. You can also check a PIN you already use. Everything happens on your device.
······
Possible PINs of this length: 1,000,000.
Made and checked on your device. Nothing is sent or saved.
The most common PIN numbers, and why they’re guessed first
People don’t pick PINs at random. In a study of PINs chosen to unlock smartphones, the five most common 4-digit PINs were 1234, 0000, 2580, 1111 and 5555 (Ruhr University Bochum, CASA). DataGenetics looked at the 4-digit codes in 3.4 million leaked passwords: 1234, 1111 and 0000 together made up close to 20% of them, and every code starting with 19 was above the 80th percentile in popularity, because people use birth years (Slate).
Longer PINs don’t fix this on their own. The researchers found that 6-digit PINs people chose were little or no harder to guess than 4-digit ones in a few tries, because 123456 and 654321 are just as popular, and that Apple’s blocklist of 274 four-digit PINs did little against an attacker limited to 10 tries (Markert et al., 2020).
This generator throws away any PIN that matches these patterns:
- one digit repeated (0000) or only two different digits (1212, 6969)
- counting up or down (1234, 9876)
- a block repeated (123123) or mirrored (1221, 123321)
- keypad shapes (2580, 1470, 159753, 147258…)
- years (1900-2099) and dates (DDMM, MMDD, DDMMYY, birthdays as DDMMYYYY)
For 4 digits that rules out about 14% of all PINs, for 6 digits about 9%. That is close to the 10% blocklist the study suggests as the best balance between safety and annoyance.
How long a random PIN holds up
A phone’s lock screen limits wrong tries; on Android the researchers could test about 100 PINs in eleven hours because of the waiting times (CASA). The harder case is someone who has copied an app’s files and guesses without those limits. The table assumes one guess per second, the speed a deliberately slow key function such as Argon2id allows on a phone (it is what Lockspeare uses), and shows the worst case: trying every PIN.
| Digits | Possible PINs | Trying all of them at 1 per second |
|---|---|---|
| 4 | 10,000 | about 3 hours |
| 6 | 1,000,000 | about 12 days |
| 8 | 100,000,000 | about 3 years |
| 10 | 10,000,000,000 | about 317 years |
| 12 | 1,000,000,000,000 | about 31,688 years |
On average a random PIN is found halfway through, so halve the times. A PIN only gets this protection if it is random: a birthday is found in minutes whatever its length.
How to remember a random PIN
- Say it in pairs or threes (48 29 15) and type it a few times right away.
- Use it daily for the first week; that is when most people forget a new PIN.
- Don’t reuse your bank card PIN or your phone’s PIN for an app that holds private things.
- If you write it down, keep it apart from the phone, and never in a note on the same phone.
Need something longer than a PIN? Encrypt text and Encrypt a file work best with a passphrase of four or more random words. Forgot the PIN of a vault app? See what to do when you forget a photo vault password.
Questions about PINs
What are the most common PIN numbers?
In a study of 4-digit PINs chosen to unlock phones, the most common were 1234, 0000, 2580, 1111 and 5555 (Ruhr University Bochum). 2580 is a straight line down the middle of the keypad. In DataGenetics’ analysis of 4-digit codes from 3.4 million leaked passwords, 1234, 1111 and 0000 together made up close to 20% of them (Slate).
Is this PIN generator random?
Yes. Each digit comes from your browser’s cryptographic random number generator (crypto.getRandomValues), with no bias toward any digit. If the result happens to match a pattern people guess first, such as 1212 or a date, it is thrown away and a new one is drawn.
Is a 6-digit PIN safer than a 4-digit PIN?
Only if it is random. There are 1,000,000 six-digit PINs against 10,000 four-digit ones, but the researchers behind “This PIN Can Be Easily Guessed” found that the 6-digit PINs people chose gave little to no extra security against someone allowed a few guesses, because people pick patterns like 123456 and 654321 (Markert et al., 2020). A random 6-digit PIN from this page has none of those patterns.
Is the PIN I type into the checker sent anywhere?
No. The check runs in your browser on your device. This page makes no network request when you type or generate a PIN, and nothing is saved after you close it.
How long should a phone PIN be?
As long as you can remember reliably. Each extra digit makes trying every PIN ten times longer. Your phone also limits wrong tries, so a 6-digit random PIN is a good minimum for a phone; for an app or vault that someone could attack after copying its files, 10 or more digits is better (see the table above).
