Skip to main content

No token data leaves your browser except JWKS public key fetches you explicitly initiate.

View source

JWT Secret Generator

Generate a cryptographically random HMAC secret for HS256, HS384, or HS512: entirely in your browser via the Web Crypto API. No secret ever leaves your machine.

Key length (bytes)

32 bytes = HS256 · 48 = HS384 · 64 = HS512

Encoding

Generated locally with crypto.getRandomValues: nothing is sent to a server.

Generate a JWT secret online

A JWT HS256 secret is a symmetric key: the same string signs and verifies tokens. Its security depends entirely on its entropy. This generator produces cryptographically random bytes with the Web Crypto API (crypto.getRandomValues) and encodes them as base64url, base64, or hex. The secret never leaves your browser, so it is safe to use even when generating production secrets: copy the output directly into your secrets manager.

How long should an HS256 secret be?

The minimum is 32 bytes (256 bits) for HS256, 48 bytes for HS384, and 64 bytes for HS512. Not a password, UUID, or memorable phrase: those are brute-forceable offline with hashcat once an attacker captures any valid token. A 32-byte CSPRNG-generated secret is effectively unbreakable with current hardware. For the full algorithm reference, see HS256.

Test your existing JWT secret's strength

The output field above is editable. Paste your current secret into it and the strength meter grades it Weak, Fair, or Strong: pairing a text label with color so the result is clear without relying on color alone. The meter flags known-weak literals (the JWT.io example, common passwords) and short or low-entropy values. If your secret grades below Strong, rotate it. For the full vulnerability writeup, see weak HMAC secret keys.

Frequently asked questions