🔢 PIN Generator
Generates random numeric PINs. The most common 4-digit PINs (like 1234, 0000, birth-year patterns) account for a disproportionate share of real-world PIN use — this tool can skip the worst offenders when generating 4-digit codes.
How much a PIN is worth
Digits are drawn with rejection sampling on crypto.getRandomValues,
so all ten are equally likely and there is no modulo bias. Each carries log2(10)
bits:
bits = length x log2(10) = length x 3.3219
4 digits = 10,000 combinations = 13.3 bits
6 digits = 1,000,000 combinations = 19.9 bits
Two extra digits multiply the search by 100 but add only 6.6 bits, which shows how little a numeric keypad gives you. A 4-digit PIN survives on the lockout after three wrong tries, not on its own strength.
The weak-PIN filter
- The blocklist holds the twenty PINs that dominate published analyses of leaked PIN data - 1234, 1111, 0000, pairs like 1212, and the year-shaped 2000 and 2001.
- It only runs at length 4. Ask for six digits and 123456 or 111111 can still come out, because the list has no entries that long.
- Removing 20 of 10,000 options changes the entropy by 0.003 bits; the filter is there for the human guesser at the keypad.
Frequently asked questions
How many combinations does a 4-digit PIN have?
Exactly 10,000, from 0000 to 9999. Real PINs are nothing like evenly spread across them: in published breach analyses, 1234, 1111 and 0000 alone account for close to a fifth of all PINs chosen by people.
Is a 6-digit PIN much safer than a 4-digit one?
A hundred times harder to guess exhaustively, 19.9 bits against 13.3. Where a device allows only a few attempts the practical gain is smaller, but there is no reason to refuse it.
What makes a PIN weak if it is not on the blocklist?
Predictability to someone who knows you. Birth dates, house numbers, the last four of a phone number and keypad shapes are all tried long before anyone works through 10,000 options.