api key & token generator_
Random secrets for APIs, sessions, webhooks and signing keys. Pick hex, base64url, alphanumeric or a prefixed API key, see the entropy, copy.
crypto.getRandomValues() with no modulo bias. A 128-bit token (16 bytes, 32 hex characters) can't be guessed; 256 bits is the usual choice for session secrets and signing keys.
crypto.getRandomValues() and a word list that ships with it. There is no backend, no logging and no analytics event
that carries what you generate. The page loads an anonymous, cookie-free page-view counter and nothing else.
Guide — how to use the api key & token generator
Generated in your browser with crypto.getRandomValues(); nothing is sent anywhere.
Hex or base64url for secrets and signing keys, alphanumeric for anything typed into a form, a prefixed key for an API you publish.
32 bytes (256 bits) is the standard choice. 16 bytes (128 bits) is the minimum for a secret.
A prefix such as sk_live_ makes leaked keys easy to find in logs and repositories.
Put it in an environment variable or secret manager, never in source control.
Questions and answers
How long should an API key or token be?
At least 128 bits (16 bytes, 32 hex characters). 256 bits (32 bytes) is the common choice for session secrets, JWT signing keys and HMAC keys.
Hex, base64url or alphanumeric?
They carry the same entropy per byte. Hex is the simplest and longest. Base64url is shorter and URL-safe. Alphanumeric is the easiest to paste anywhere.
Why add a prefix to an API key?
A recognisable prefix lets secret scanners and humans spot a leaked key quickly, and tells you which system to revoke it in. The prefix adds no entropy.
Is this suitable for a JWT secret?
Yes: use 32 bytes of hex or base64url. Generate it once, keep it server-side and rotate it if it leaks.
Is anything sent to a server?
No. Tokens are created in the page with crypto.getRandomValues(). There is no backend that sees them.
Want the full story on entropy, crack times and what NIST SP 800-63B says? See the complete random password generator, which also includes a password checker and bulk export.