PIN Generator
Generate random numeric PINs of any length with cryptographic randomness, with the real number of possible combinations shown.
Everything on this page happens in your browser. Generated secrets are never sent anywhere, never logged and never stored — close the tab and they are gone, so copy anything you need first.
What the PIN Generator does
This PIN generator will generate random numeric PINs of any length with cryptographic randomness, with the real number of possible combinations shown. Paste your text in, pick the options you need, and copy the result straight back out. It is most often used for choosing a card or phone PIN that is not a date. If you need the other side of this job, there is also a caesar cipher.
How to use it
- Set the number of digits — four for a card, six or more for anything not protected by a lock-out.
- Optionally group the digits with dashes to make a long code easier to read aloud.
- Type anything in the input box to generate a fresh batch.
- Check the combinations figure to see how much protection that length actually buys.
How it works
A PIN is only as strong as its length and its randomness, and four digits is just 10,000 possibilities — about 13.3 bits. That is trivial for a machine but adequate for a bank card, because the card locks after three wrong attempts. The security there comes from the lock-out, not from the PIN, which is why the same four digits would be hopeless protecting a file.
Human-chosen PINs are far weaker than the arithmetic suggests. Analyses of leaked PIN data have found that the single most common four-digit code, 1234, accounts for roughly one in ten of all PINs chosen, and the twenty most common cover a substantial fraction of the total. Dates of birth, repeated digits and keypad patterns absorb most of the rest. A generated PIN avoids all of that because it does not care whether the result looks like a year.
Leading zeros are preserved here, which some generators silently drop. A PIN of 0042 is a perfectly valid four-digit code and excluding it would shrink the keyspace. The grouping option inserts dashes for readability only — it does not change the number of possibilities, and you type the digits without the dashes.
Where a PIN protects something that is not rate-limited, length is the only lever you have. Six digits gives a million combinations, eight gives a hundred million, and twelve gives about 39.9 bits — still far weaker than a short random alphanumeric password, because ten symbols per position is a very small alphabet. If the thing you are protecting allows letters, use letters.
When to use it
- Choosing a card or phone PIN that is not a date.
- Generating door-entry or alarm codes for a building.
- Creating numeric verification codes for testing.
- Producing a long numeric passcode for a device that only accepts digits.
Common mistakes to avoid
- Using a birth year, an anniversary or a keypad pattern. These are the first things guessed.
- Treating a four-digit PIN as security on something without a lock-out. 10,000 guesses takes a computer no time at all.
- Rejecting a generated PIN because it "looks like" a date. Filtering the output on appearance reintroduces exactly the bias you came here to avoid.
Frequently asked questions
How many combinations does a 6-digit PIN have?
One million, from 000000 to 999999, which is about 19.9 bits of entropy. A four-digit PIN has only 10,000, and an eight-digit one has 100 million.
Is a 4-digit PIN safe?
Only when something limits the number of attempts. A bank card is safe with four digits because three wrong tries locks it. The same PIN on an encrypted file would be cracked in a fraction of a second.
Why does this generator keep leading zeros?
Because 0042 is a valid code and removing it would reduce the keyspace from 10,000 to 9,000, making every PIN slightly weaker for no benefit.