Secret and API key generator
Generate strong random secrets in the format you need: hex, base64url, letters and digits, passwords, prefixed API keys, UUIDs and passphrases. Everything is made in your browser with crypto.getRandomValues. The values never leave your device.
Made in your browser with crypto.getRandomValues. Nothing is sent to our server or logged. You can disconnect from the internet and it still works.
How it works
Each value comes from crypto.getRandomValues, the browser’s cryptographically secure random generator. Characters are picked by rejection sampling, so every character is equally likely (no modulo bias). Passphrases use the EFF short wordlist (1,296 words, CC BY 3.0 US). Nothing is sent over the network: values are not included in the page’s analytics, which only counts that the tool was used.
Which format to use
- Session, cookie and JWT signing secrets: Base64url or Hex, 32 bytes for HS256 and 64 bytes for HS512.
- API keys you issue: the prefixed format, 32 characters or more (about 190 bits).
- Database and service passwords: letters and digits, 32 characters or more. They avoid quoting problems in URLs and .env files.
- Things a human types: a passphrase of 6 or more words.
FAQ
Is it safe to generate secrets on a website?
This one runs only in your browser using crypto.getRandomValues, the same random source password managers use. The values are never sent to our server, never logged, and not included in analytics. You can load the page, go offline, and keep generating.
How long should a JWT secret be?
At least as long as the hash: 32 random bytes for HS256, 48 for HS384, 64 for HS512. Use the Base64url or Hex format at that length. Short or memorable secrets can be brute-forced offline from a single token.
How many bits of randomness do I need?
128 bits is enough for most API keys and tokens, and 256 bits is a comfortable default. A 6-word passphrase from the EFF list has about 62 bits, which is fine for something a person types, not for a machine-to-machine key.
Why give API keys a prefix?
A prefix like sk_ or acme_live_ makes keys easy to recognise, so secret scanners (and GitHub's push protection) can catch them when they leak, and people can tell test and live keys apart.