A random PIN that avoids the usual traps
This random PIN generator draws a 4 digit PIN, or any length from 3 to 12 digits, using your device's cryptographic random number source. Use it for a phone, a SIM card, a garage door keypad, a combination lock or a home alarm, and stay clear of the codes everyone tries first.
Everything happens in your browser. PINs are never sent or saved; only your settings are remembered on your device.
How to use it
- Under "Length", pick "4 digits", "6 digits" or "8 digits", or type a value in "Number of digits (3 to 12)".
- Set "Number of PINs (1 to 100)". PINs in the same batch are all different.
- In "Leave out weak PINs", tick the rules you want: "All digits the same (1111)", "Ascending or descending runs (1234, 9876)", "Repeated patterns (1212, 123123)", "Years 1940 to 2025 (4-digit PINs)" and "Very common PINs (0000, 2580, 1122…)".
- Click "New PIN" or press the space bar. "Copy" copies one PIN; "Copy all PINs" copies the list, one per line.
- Tick "Hide PINs" if someone can see your screen: the PINs are blurred and a click reveals one.
How many PINs are possible?
Each digit has 10 possible values, so a 4 digit PIN has 104 = 10,000 combinations and a 6 digit PIN has 106 = 1,000,000. Entropy is the base-2 logarithm of that number: 13.29 bits for 4 digits, 19.93 bits for 6.
Leaving codes out lowers the total slightly, and the tool shows the exact count under "Possible combinations". Here is the rule "no identical digits and no runs" for 4 digits:
| PINs left out | Count |
|---|---|
| All digits the same, 0000 to 9999 | 10 |
| Ascending runs, 0123 to 6789 | 7 |
| Descending runs, 3210 to 9876 | 7 |
| PINs left | 10,000 − 24 = 9,976 |
Entropy drops from log2(10,000) = 13.288 bits to log2(9,976) = 13.284 bits, a loss of 0.003 bits. With all five rules ticked, 9,791 four-digit PINs remain, or 13.26 bits. The cost is tiny, while the PINs removed are exactly the ones a thief tries first. With three attempts before a card locks, the chance of a lucky guess stays at 3 in 9,791, about 0.03%.
The draw stays uniform: each digit from 0 to 9 is picked without bias, and if the PIN matches a ticked rule it is thrown away and drawn again. Every remaining PIN has exactly the same chance.
Safety tips
- Use a different PIN for your bank card, your SIM card and your phone.
- Never write the PIN next to the card, in your wallet or on the back of your phone.
- Cover the keypad with your hand at a cash machine or a shop till.
Frequently asked questions
Can the site see my PIN?
No. The PIN is drawn on your device and is not sent anywhere.
Can I set my own bank card PIN?
Many banks let you change it at a cash machine or in their app. If yours does, this generator keeps you away from predictable choices.
Why leave out years?
Many people use their birth year or a relative's. Between 1940 and 2025 that is 86 codes, quick to test for anyone who knows you.
Is a 4 digit PIN enough?
For a card that locks after three wrong tries, yes. For a lock or keypad that never locks, choose 6 digits or more when you can.