How to use
Use this tool to generate (sign) and verify HS256 JWTs locally.
- Enter your Payload JSON (required) and optionally edit the Header JSON.
- Provide a Secret (HMAC key). Optionally add iat and exp.
- Click Generate HS256 JWT to produce the token.
- To validate, paste a token into Token to decode/verify and click Decode + Verify.
FAQ
What is HS256 in JWT?
HS256 means the JWT is signed with HMAC using SHA-256 and a shared secret (same key for signing and verification).
Does this tool send my secret or token to a server?
No. Signing and verification run locally in your browser using the Web Crypto API, with no network requests.
Why does verification fail even with the right secret?
The header/payload must match exactly what was signed, and the token must be Base64URL-encoded correctly; any change breaks the signature.
Can I use this to verify tokens signed with RS256 or ES256?
No. This tool supports HS256 only; RSA/ECDSA tokens require public/private keys and different verification logic.
What do iat, exp, and nbf mean?
iat is issued-at time, exp is expiration time, and nbf is “not before” time (all in Unix seconds).
Should I trust the JWT payload content?
Only if the signature verifies with a trusted secret; otherwise the payload can be forged.
Why force alg=HS256?
It prevents algorithm confusion (e.g., a token claiming a different alg) by ensuring generation and verification are strictly HS256.