Random PIN generator
A random 4-digit PIN is ready below. Move the Digits slider for a 6-digit code or longer; obvious codes such as 1234 or 0000 never come up.
What you type stays in your browser
Weak
13 bits of entropy
Time to guess offline: under a second
PINs made of one repeated digit or a straight run such as 1234 or 9876 are skipped.
Made on this device with your browser's secure random generator. Never sent or saved.
In short
A good PIN is random, not a date, a pattern or a repeated digit. This generator draws each digit with the browser's secure random source and skips codes like 0000 and 1234. Use 6 digits where you can: that is 1,000,000 combinations instead of 10,000.
How to generate a random PIN
- PIN is selected at the top and the Digits slider is at 4. Slide it to 6 for a phone unlock code or a newer bank card.
- Read the PIN in the large box. Each press of Generate new draws a fresh code with equal chances for every allowed combination.
- Press Copy PIN if you are setting it on this device, or simply read it off the screen for a card terminal or keypad.
- Repeat it a few times to learn it, and do not write it on or near the card, phone or lock it protects.
Why people's own PINs are easy to guess
Studies of leaked PIN collections keep finding the same thing: a small set of codes covers a large share of all PINs. 1234, 1111, 0000, 1212 and 7777 lead the list, followed by years of birth from 19xx and calendar dates such as 0101 or 1225. A thief who tries the most popular codes within the allowed attempts unlocks a noticeable share of cards and phones.
A randomly drawn PIN gives no such head start. Each of the roughly 10,000 four-digit codes is equally likely, so three or ten guesses succeed only three or ten times in ten thousand. This tool also refuses the 24 codes that consist of one repeated digit or a straight run up or down, because those are the first ones anyone tries.
Frequently asked questions
What is a good 4-digit PIN?
One that is chosen at random and has nothing to do with you: no birthday, year, house number or part of your phone number, and no keypad pattern like 2580. Generate one here and avoid changing it toward something more familiar.
Is a 6-digit PIN safer than 4 digits?
Yes, by a factor of one hundred: 1,000,000 possible codes instead of 10,000. Phones usually allow 6 digits or more, and some banks do too. Combined with an attempt limit, a random 6-digit PIN is very hard to guess.
Which PINs should I never use?
Repeated digits (0000, 1111), straight runs (1234, 4321), pairs like 1212, years from 1940 to 2010, dates in day-month or month-day form, and the corners or columns of the keypad such as 2580 or 1397. The generator already skips repeated digits and straight runs.
Can someone see the PIN I generate here?
No one else receives it. The digits are created by JavaScript in your own browser tab and are not sent or saved. Still, mind the people around you and the screen itself, the same as at a cash machine.
Can I use a generated PIN for my bank card?
Yes, if your bank lets you choose the PIN at a cash machine, in the app or at the branch. Most cards use 4 digits; some accept up to 6 or more. Never share the PIN with anyone who calls or messages you, bank staff included.
How many attempts does a thief get?
Bank cards usually block after three wrong PINs. Phones add growing delays and may erase themselves after ten failures if that option is on. With so few tries, a random PIN almost never falls to guessing, while a popular one often does.
Uses for a random PIN
Use a different PIN for each purpose, so a code someone watches you enter at a shop does not also open your phone or your front door.
- Phone and tablet unlock codes: 6 digits or more.
- Bank and credit card PINs, chosen in the app or at a cash machine.
- Door keypads, safes, alarm panels and garage openers.
- SIM card PINs and voicemail codes, which many people leave at the default.
- Parental control and app lock codes.
When a PIN is not enough
PINs work because the device limits attempts. Wherever the code could be tested at full speed, such as for an encrypted file or an online account, use a password or a passphrase instead.
How your files stay private
This tool runs with JavaScript inside your browser tab. What you type, the settings you choose and the results stay in the page's memory and disappear when you close it. Nothing is sent to a server; a few display settings may be remembered in your own browser.
Presets
Related tools
- QR code generator Make free static QR codes for links, Wi-Fi, contacts and text. PNG or SVG, never expires.
- Random number generator Random whole numbers in any range, with no-repeat draws, dice, coin flips and a name picker.
- Protect PDF Add a password to a PDF or restrict printing and copying, encrypted on your device.
- Word counter Count words, characters, sentences and reading time live as you type or paste.
- Case converter Change text to upper, lower, title, sentence, camel, snake or kebab case in one click.
- Online timer Countdown timer with a loud alarm, full screen mode and a lap stopwatch. Exact in background tabs.
Guides
Last updated Nov 20, 2026