JWT generator (sign HS256 tokens)
Create and sign JWT tokens with HS256, HS384 or HS512 from a JSON payload and a secret key, with shortcuts for iat, exp and sub, and verify the signature of an existing token.
Create and sign a JSON Web Token
JWT generator (sign HS256 tokens): what it is for
Write the payload in JSON, enter the secret key and choose the algorithm. The tool builds the header, encodes everything in Base64 URL and signs the token with HMAC through the Web Crypto API. Buttons add the iat and exp claims, and a field checks whether an existing token's signature matches the key.
The token is signed in your browser and the key isn't sent to any server.
How to use
- Write the payload in JSON.
- Enter the key and the algorithm.
- Copy the token or verify another one.
When to use it
- Testing APIs that require JWT authentication.
- Creating tokens for development environments.
- Understanding how a JWT signature works.
Frequently asked questions
What is a JWT?
It's a token in the header.payload.signature format, each part in Base64 URL. The payload carries the information (claims), such as the user (sub) and the expiry (exp), and the signature guarantees nobody changed the content without knowing the key.
Is the payload encrypted?
No. Anyone can decode and read the payload of a signed JWT. The signature only prevents changes. Never put passwords or sensitive data in the token.
Which key should I use for HS256?
A long, random secret key of at least 32 bytes, kept only on the server. For testing, you can create one with the password generator. The tool signs in the browser with the Web Crypto API.
Is it really free?
Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.