JWT Secret Generator
Generate a strong random JWT signing secret sized for HS256, HS384 or HS512, as Base64url, Base64 or hex, optionally as a .env line. Secure and in-browser.
Runs in your browser. Nothing is uploaded.
About JWT Secret Generator
JWT Secret Generator creates a random key for signing JSON Web Tokens with HMAC. The key is sized to match the algorithm: 32 bytes for HS256, 48 for HS384 and 64 for HS512, as RFC 7518 recommends. A short or guessable secret lets attackers forge tokens offline.
Pick the encoding your library expects and, if you like, copy it as a ready-made JWT_SECRET= line for your .env file. Keep it out of source control and rotate it if it ever leaks.
How to use JWT Secret Generator
- Set the options you want.
- Your result is generated straight away. Press Generate again for a new one.
- Copy the result with one click.
Frequently asked questions
How long should a JWT secret be?
At least as long as the hash output: 256 bits (32 bytes) for HS256. Human-made phrases are far too weak.
Should I use HS256 or RS256?
HS256 is fine when the same service signs and verifies. Use RS256 or ES256 when other parties must verify tokens without being able to sign them.
Is JWT Secret Generator free and private?
Yes. JWT Secret Generator is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.