How to use it
- Choose the characters: hex, letters and digits, Base64url, or with symbols.
- Set the length, how many keys you need, and an optional prefix such as sk_live_.
- Check the strength line: 128 bits or more is strong for API keys and session secrets.
- Copy the keys or download them, and store them in your password manager or secret store.
Strong secrets, made on your device
API keys, webhook signing secrets, JWT signing keys, session secrets and encryption passphrases must be unpredictable. Keys made with Math.random() or by hand are not. This generator uses crypto.getRandomValues(), the browser's cryptographically secure random source, and picks characters without bias so every character is equally likely. Because the keys are created locally and never transmitted or stored, nobody else has ever seen them.
The strength shown is the number of random bits: length × log2(number of possible characters). 32 Base64url characters give 192 bits, far beyond what can be guessed. Hex is the safest choice for systems that are picky about characters; symbols give more strength per character but can break shell scripts, URLs and .env files.
Using prefixes
Services like Stripe and GitHub start keys with a readable prefix (sk_live_, ghp_) so leaked keys are easy to recognise and secret scanners can find them in code. The prefix is not random and does not add strength, so keep the random part at full length.
Questions
- How long should an API key be?
- At least 128 bits of randomness: 32 hex characters, or 22 Base64url characters. 256 bits (64 hex) is common for signing keys.
- Do you keep a copy?
- No. The keys are generated in your browser and are never sent or saved. If you lose them, generate new ones.
- Can I use these as passwords?
- Yes, they are strong passwords, though long random strings are hard to type. Store them in a password manager.
- Is what I paste sent to a server?
- No. The tool runs as JavaScript in your browser. Your text, files and keys stay on your device, so it is safe to use with internal data, tokens and customer records. It keeps working offline after the page has loaded once.