Secure PIN Generator
🔒 Drawn with crypto.getRandomValues, 100% in your browser. Nothing is sent anywhere — refresh the page and the PIN is gone. Memorize it or store it in a password manager.
⚠️ A PIN is only safe behind a lockout. Offline, even a 12-digit PIN falls in about 1.7 minutes at 10 billion guesses/sec — see below. Never use a PIN as the sole secret on anything that does not lock you out after a few wrong tries.
Copied to clipboard.
Two models, both honest. Offline crack time assumes a leaked hash attacked at 10 billion guesses/sec. "Chance in 10 tries" assumes the device locks after 10 wrong attempts — the model that actually governs phones, ATMs and door locks.
How this estimate works
Entropy = log₂(combinations). With a leading zero allowed, combinations = 10length; without one, 9 × 10length−1. Offline crack time = 2entropy ÷ 10,000,000,000 guesses per second — the same documented model as the rest of PasswordLab.
Quick reference (leading zero allowed)
- 4 digits — 13.3 bits, 10,000 combinations. A 10-try lockout still leaves a 0.1% guess chance — fine only on a device that truly locks.
- 6 digits — 19.9 bits, 1,000,000 combinations. The standard phone PIN; 0.001% in 10 tries, but offline it falls instantly.
- 8 digits — 26.6 bits, 100 million combinations. Noticeably better, and still easy to type.
- 12 digits — 39.9 bits, 1 trillion combinations. Offline crack time about 1.7 minutes — which is the point: no PIN is strong offline.
The lockout is the security, not the digits. If a system lets an attacker try unlimited PINs, no PIN length saves it — use a password or a passphrase there instead. And never reuse a PIN you picked yourself from a birthday, a year, or a pattern: this generator's output is uniform random, so it carries none of that risk.
FAQ
Is a 6-digit PIN secure?
Only behind a lockout. It has just 1,000,000 combinations (19.9 bits), so an offline attack against a leaked hash cracks it in a fraction of a second. On a phone that locks after 10 wrong tries, an attacker has only a 0.001% chance — the lockout, not the PIN, is what protects you.
How random is the generated PIN?
Each digit comes from crypto.getRandomValues with rejection sampling (no
modulo bias), entirely on your device. There is no server, no analytics, no network request.
What does "allow leading zero" change?
A 6-digit PIN that may start with 0 has 1,000,000 combinations; forbidding a leading zero leaves 900,000 (19.8 bits vs 19.9). The gap is tiny — the option exists because some systems reject PINs starting with 0, not because it matters for security.
Why not just use a longer password instead?
Wherever a full password or passphrase is accepted, use one: a 12-character password has about 77 bits versus 19.9 bits for a 6-digit PIN. PINs exist because some systems (phones, ATMs, door locks) only accept digits; this generator makes the best of that constraint.
Should I avoid birthdays and patterns?
Yes, if you pick your own PIN — attackers try birthdays, years, 1234 and repeated digits first. A PIN from this generator is uniform random and has no such weakness; the risk only returns if you replace it with a memorable date.
Does this site see my PIN?
No. Generation and all math happen inside this page. Refreshing destroys the PIN, so memorize it or store it in a password manager before you leave.