JWT Key Generator
Generate cryptographically secure JWT signing keys in bulk — entirely in your browser.
Defaults to 5. Every click generates a brand new, unrelated set.
Last updated:
Generate secure JWT signing secrets
This JWT key generator creates random secrets for signing tokens with the HMAC algorithms HS256, HS384 and HS512. You choose the strength and the output format, and it makes up to 20 keys in one go. Each click produces a new, unrelated set.
How to use it
- Pick a Key Strength: 256-bit (32 bytes) for HS256, 384-bit (48 bytes) for HS384 or 512-bit (64 bytes) for HS512.
- Pick an Output Format: Base64 URL-safe, Base64 or Hex.
- Set the Number of Keys from 1 to 20. The default is 5.
- Click Generate Keys.
- Copy a single key with its button, or use Copy All to get them one per line.
How it works
The tool asks the browser for random bytes with crypto.getRandomValues(), the same source used for cryptographic purposes, and encodes them in the format you chose. Base64 URL-safe swaps + and / for - and _ and drops the padding. Hex gives two characters per byte, so a 32-byte key is 64 hex characters.
Assumptions and limits
- These are shared secrets for HMAC signing (HS256, HS384, HS512). The tool does not generate RSA or ECDSA key pairs.
- Keys are not saved. If you leave the page or generate again, the old ones are gone, so copy what you need.
- The page says generation runs in your browser and nothing is sent to a server.
- Store secrets in an environment variable or a secrets manager, not in source code.
Frequently asked questions
Which strength should I choose?
Match it to the algorithm in your token header: 32 bytes for HS256, 48 for HS384, 64 for HS512. A key at least as long as the hash output is the usual guidance.
Does the format change how strong the key is?
No. The same number of random bytes is used. The format only changes how the bytes are written as text. Use whichever your library or config file expects.
Can I generate keys for RS256?
No. RS256 needs a public and private key pair, which this tool does not create.
Related Security
Browse all tools from the same category.
TOTP / OTP Generator
Generate time-based one-time passwords
Open toolRandom Token Generator
UUID, API key, CSRF token, and hex strings in bulk
Open toolShowing 1-2 of 7