API Key & Secret Generator
A secret is only as good as its randomness and its length. This generator asks the Web Crypto API for N bytes and encodes them in the format your framework expects:
- hex: 2 characters per byte, what most
.envexamples and AES key fields want - base64 / base64url: 4 characters per 3 bytes; base64url is safe in URLs, headers and JWT secrets
- base62: letters and digits only, for keys that must survive copy-paste through anything; length is computed to match the requested bits
- UUID v4: 122 random bits in the familiar 36-character format
32 bytes (256 bits) is the sensible default: it matches HS256 JWT signing, AES-256 keys and every “secret key” setting in Django, Rails, Laravel or Express. A prefix such as sk_live_ helps secret scanners recognise leaked keys in repositories, which is why Stripe and GitHub use them.
What leaves your browser
Secrets are generated in your browser and displayed once. Nothing is transmitted, logged or stored. Copy the value into your secrets manager, then close the tab. Never paste a secret into a chat, ticket or commit.
How long should a JWT secret be?
At least 256 bits (32 bytes) for HS256, and 512 bits for HS512. Shorter secrets can be brute-forced offline from a single captured token.
Is base62 weaker than base64?
No. The tool lengthens base62 output so the total entropy matches the requested bits. It is just a different alphabet.
Should I use this for production secrets?
The randomness is the same quality your server would produce with openssl rand or crypto.randomBytes. The risk is handling: generate on a trusted machine, copy once, store in a vault.
Why not just use a UUID as an API key?
A v4 UUID has 122 bits, which is plenty, but its fixed format makes it obvious and it lacks a scanner-friendly prefix. Fine for internal ids; use a prefixed base62 key for customer-facing APIs.