How to generate a JWT
A JSON Web Token lets you prove that a payload was created by someone holding a shared secret. It has three parts — header, payload, and signature — joined by dots and base64url-encoded.
This tool builds and signs the token entirely in your browser using the Web Crypto API. Your secret and payload never leave the page.
Edit the header and payload
The header declares the algorithm and token type. The payload holds your claims — iss, sub, iat, exp, or anything custom. Both must be valid JSON or the token can't be built.
Choose algorithm and expiry
Pick HS256 for broad compatibility, or HS384/HS512 for longer digests. The expiry option adds an exp claim automatically: 15 minutes up to 30 days, or none if you set dates yourself.
Set a strong secret
The HMAC secret is what protects the token, so use a long random string — the Random secret button generates a cryptographically secure 32-byte value for you.
Generate and decode
Click Generate to create the signed token, copy it with one click, and check the decoded table below to verify exactly what was signed. Everything happens locally in your browser.