Toolstia / JWT generator
JWT generator
Write a JSON payload, enter a secret, and get a signed JWT using HMAC SHA-256, 384 or 512. The tool can add issued-at and expiry claims for you. It is meant for testing and development.
Tokens are signed in your browser with the Web Crypto API and your secret never leaves this page. Use it for testing and learning. Real secrets belong on a server, and a JWT is signed but not encrypted, so never put private data in the payload.
How it works
- Edit the payload JSON.
- Enter a secret and choose the algorithm.
- Copy the token or any of its three parts.
Parts of a token
A JWT is three Base64URL strings joined by dots: the header, the payload and the signature.
Claims
Turn on iat to add the current time, and set a number of minutes to add an exp claim that expires then.
Secrets
Use a throwaway secret. Anything you type is kept in the page only, but a real production secret should never be pasted into any website.
Checking the result
Paste the token into the JWT decoder to confirm the claims, or verify the signature in your own code.
Questions
Is it safe?
The signing runs in your browser through the Web Crypto API. Everything happens in your browser, and nothing you enter is sent anywhere. Still, use test secrets only.
Can it make RS256 tokens?
No. Only HMAC algorithms are supported, since they need just a shared secret.
Why is my token different each time?
When iat or exp is on, the timestamps change every second, so the token changes too.