Plinkr

Random PIN code generator — 4-digit or 6-digit

Generate a random 4-digit or 6-digit PIN code, lock combo, or arbitrary numeric code by setting the min and max. For a 4-digit PIN, set min=1000 and max=9999. For 6-digit, set min=100000 and max=999999. Each tap draws a fresh number. "Random 4 digit number" / "random 6 digit number generator" / "random PIN generator" all land here. You're setting up a smart lock for a vacation rental and need a 4-digit guest PIN that isn't a memorable date pattern (no 1234, no 1111, no your-birth-year-twice). Set min=1000 max=9999, tap Generate, copy the result into the lock admin app. The number is uniformly random across the full 1000-9999 range, so 9876 is as likely as 5483 or 2017. Cryptographically secure. The underlying RNG uses crypto.getRandomValues with rejection sampling, so generated PINs are uniformly distributed and not predictable from one to the next. Suitable for lock combos, ticket numbers, or random sample selection — anywhere you would otherwise reach for a hash-of-timestamp shortcut. Clean ad-free UI vs sketchy PIN-generator sites with overlay ads.

Frequently asked questions

Is this secure enough for a real lock combo or door PIN?

Yes. The RNG uses crypto.getRandomValues, the same browser-provided cryptographic primitive used for session tokens and key generation. Rejection sampling ensures uniform distribution across the range. For a 4-digit PIN that's the upper bound of what 4 digits can offer; if higher entropy matters, generate 6 digits or longer.

Will it avoid weak patterns like 1234, 1111, or 0000?

No automatic filter — the generator treats every value in the range as equally likely, so 1234 is exactly as likely as 5483. If you want to exclude weak patterns, regenerate when one comes up. Across the 9000-PIN range of 1000-9999, weak patterns are rare enough that one or two re-rolls handles it.

Can I generate multiple PINs in batch — say 50 at once for a vacation rental?

One at a time today. Tap Generate for each PIN, copy the result, repeat. For batch generation of dozens of unique PINs, a small script using the same crypto.getRandomValues primitive is more practical than tapping repeatedly. The single-PIN UI fits the typical use case (one lock, one PIN).

Is the generated PIN logged anywhere?

No. The PIN appears on your screen and is encoded in the URL state for that tab; nothing is sent to a server. When you close the tab, the PIN is gone from Plinkr's side. If you need to record the PIN, copy it to your password manager or write it down — Plinkr does not retain it.


More ways to use the Random Number Generator:

Random Number Generator overview