What does signing a JWT do?
Signing a JWT does not hide anything — the header and payload are Base64URL, which anyone can decode. What the signature provides is integrity: it proves the token was issued by someone holding the secret and has not been altered since. An HMAC signature (the HS family) uses one shared secret for both signing and verifying, which is fine when the same service does both, but means every party that can verify a token can also mint one. That is the moment to move to RS256 or ES256, where verification only needs the public key.
How to use this tool
- 1 Edit the payload as JSON — these are your claims, such as sub, name or role.
- 2 Pick an expiry and whether to stamp iat; both are added to the payload automatically.
- 3 Choose HS256, HS384 or HS512 and enter your signing secret.
- 4 Copy the token from the right — the three colours mark header, payload and signature.
Frequently asked questions
Is my secret sent to a server?
No. Signing runs entirely in your browser through the WebCrypto API (crypto.subtle), the same primitive your runtime would use. The secret and the token never leave the page — you can disconnect from the network and this still works.
Should I use a production secret here?
No, and not because of this page. A production signing secret should never be pasted into any browser tool, extension, or chat window — the risk is your own clipboard history, screen sharing and browser extensions, not the tool. Use a throwaway secret for testing and keep the real one in your secret manager.
Why no RS256 or ES256?
Those sign with a private key, and a private key is exactly the thing that should never be pasted into a web page. Offering the option would invite people to do the wrong thing. Generate asymmetric tokens in your own runtime, where the key stays in your control.
How long should my secret be?
At least as long as the hash output: 256 bits (32 bytes) for HS256, 384 for HS384, 512 for HS512. RFC 7518 requires it. A shorter secret weakens the signature and makes brute-forcing feasible — the status line here warns you when yours is too short.
What is the difference between exp and iat?
exp is the expiry timestamp — after it passes, verifiers must reject the token. iat is when it was issued, which lets a server enforce its own maximum age or invalidate everything issued before a breach. Both are Unix seconds, not milliseconds; using milliseconds is a very common bug that yields tokens valid for 50,000 years.