About PIN / OTP Code Generator
This random PIN generator lists 1 to 50 numeric codes, each exactly as many digits as you set between 3 and 12. Codes are text, not numbers, so a result such as 079849 keeps its leading zero when copied or downloaded. A 4-digit PIN has 10,000 possible values and a 6-digit code has 1,000,000, and the Details panel shows that count and the matching entropy for any length. Two switches shape the list: one stops codes starting with 0, the other drops any code with the same digit four or more times in a row. The codes are random digits only. They are not linked to any account, so they will not work as real one-time passcodes.
PIN combinations and entropy by number of digits
Combinations and entropy are the values the tool reports for each length. The last column gives places a code of that length is commonly used.
| Digits | Combinations | Entropy | Where this length appears |
|---|---|---|---|
| 3 | 1,000 | 10 bits | Three-dial luggage and bike locks |
| 4 | 10,000 | 13.3 bits | Bank cards, SIM cards, older phone passcodes |
| 5 | 100,000 | 16.6 bits | Some door keypads and alarm panels |
| 6 | 1,000,000 | 19.9 bits | Phone passcodes, text message and authenticator codes |
| 7 | 10,000,000 | 23.3 bits | Longer verification codes |
| 8 | 100,000,000 | 26.6 bits | SIM unlock (PUK) codes, 8-digit authenticator codes |
| 9 | 1,000,000,000 | 29.9 bits | Reference and booking numbers in test data |
| 10 | 10,000,000,000 | 33.2 bits | Long device passcodes |
| 11 | 100,000,000,000 | 36.5 bits | Long numeric identifiers in test data |
| 12 | 1,000,000,000,000 | 39.9 bits | The longest PIN the card PIN standard ISO 9564 allows |
The tool shows combinations as a power of ten, for example 10^6. With Allow a leading zero unticked the true count is nine tenths of the figure shown, because the first digit is limited to 1 to 9.
Sample codes for common settings
Real output from the tool. Every press of Generate produces a different list.
Five 4-digit PINs
Digits 4, How many 5
9348, 5307, 9849, 8962, 4378
Five 6-digit codes, leading zero allowed
Digits 6, How many 5, Allow a leading zero ticked
934853, 079849, 896243, 786776, 403271
The second code starts with 0 and is still six characters long.
Five 6-digit codes, no leading zero
Digits 6, How many 5, Allow a leading zero unticked
934853, 179849, 996243, 786776, 503271
Every code starts with 1 to 9, so each one is also a valid six-digit number.
8-digit codes
Digits 8, How many 5
93485307, 98498962, 43786776, 40327120, 69320680
One 12-digit code
Digits 12
934853079849
The maximum length. Entropy 39.9 bits.
What the two filters do and do not catch
Allow a leading zero controls only the first digit. When it is unticked, the first digit is drawn from 1 to 9 and every other digit from 0 to 9. Untick it when codes pass through a spreadsheet, a numeric database column or a form field of type number, any of which will silently turn 0427 into 427.
Avoid 4+ repeating same digit rejects a code if one digit appears four or more times in a row anywhere in it. For 4-digit PINs that removes exactly ten codes, 0000 through 9999 in steps of 1111, leaving 9,990. For longer codes it also removes values such as 511112. It never has any effect on 3-digit codes.
The filter is narrow on purpose. It does not remove sequences such as 1234 or 4321, repeated pairs such as 1212, keypad lines such as 2580, or anything that looks like a year or a date. If you are choosing a PIN for real use, look through the list and skip any code with an obvious pattern. Duplicates are not removed either: in a list of 50 four-digit codes there is roughly a one in nine chance that two are the same.
PIN, OTP, TOTP: why random digits are not a working passcode
A PIN is a fixed secret you choose once and reuse, checked by a card, phone or lock that limits how many wrong attempts it will accept. That attempt limit is what makes four digits tolerable. Without it, 10,000 possibilities can be tried in moments.
A one-time passcode is valid for a single use. Time-based codes from an authenticator app follow the TOTP standard, RFC 6238: the app and the service share a secret key and each computes the same code from that key and the current 30-second time window, usually six digits. Counter-based codes follow HOTP, RFC 4226. Codes sent by text message are generated and remembered by the service.
In every case the service only accepts the value it expects. A random PIN generator has no shared secret and no connection to any service, so its codes are useful as stand-ins: filling an OTP field in an automated test against a mocked backend, checking that an input accepts exactly six digits and keeps leading zeros, or making screenshots that do not expose a live code.
Choosing a PIN you will actually use
A random code beats one you invent, because people pick the same small set of dates and patterns.
- Use six digits wherever the device or card allows more than four.
- Generate a handful and take one from the list instead of pressing Generate until a code looks familiar, which quietly brings your preferences back in.
- Skip any code that is a birthday, anniversary, house number or part of your phone number.
- Do not reuse the same PIN for your phone, bank card and door alarm.
- This tool uses a simple seeded generator started from one of a million seeds, not a cryptographic random source. That is fine for picking a PIN that is protected by an attempt limit and for test data, but do not rely on long codes from it as secrets.
Using PIN / OTP Code Generator
- 1
Enter the number of Digits, from 3 to 12. The default is 6.
- 2
Enter How many codes you want, from 1 to 50.
- 3
Untick Allow a leading zero if the code will be stored or typed as a number, where 0427 would become 427.
- 4
Tick Avoid 4+ repeating same digit to drop codes such as 0000 or 511112.
- 5
Press Generate for a new list, then copy a code or download pins.txt.