How to use the JWT Generator
- Choose the signing algorithm.
- Edit the payload claims and set an expiry.
- Enter or generate a secret, then copy the signed token.
What does this tool do?
A JWT has three Base64URL parts: a header naming the algorithm, a payload of claims, and a signature. HMAC algorithms (HS256/384/512) sign with a shared secret that the server also knows.
Signing uses your browser's Web Crypto API, so the secret never leaves your device. Decode tokens with the JWT Decoder.
Why use it?
- HS256, HS384 and HS512.
- iat and exp claims added for you.
- Random secret generator.
Use cases
- Test protected API endpoints locally.
- Create tokens with short expiry to test refresh flows.
- Learn how JWTs are built.
What a token is made of
The header {"alg":"HS256","typ":"JWT"} encodes to eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. A dot, the encoded payload with claims like sub and exp, another dot, then the signature. Anyone can decode the first two parts, so never put secrets in them.
Common mistakes
- Putting passwords or private data in the payload — it's only encoded, not encrypted.
- Short, guessable secrets.
- Using test secrets or tokens in production.
Accuracy and limits
- For testing only. Don't paste production secrets into any website.
Privacy
The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.
Frequently asked questions
What is exp?
The expiry time, as a Unix timestamp in seconds.
HS256 or RS256?
HS256 uses a shared secret; RS256 uses a private and public key pair. This tool signs HMAC tokens.
Is my secret sent anywhere?
No. Signing uses your browser's Web Crypto API.
Content last updated . See how M2Toolkit works.