How to decode a JWT
Paste the token, with or without the Bearer prefix. The header and payload are decoded as you type, every claim is listed with its meaning, and timestamps such as exp and iat are shown as dates with how long until the token expires or how long ago it did. Nothing is sent to a server, so it is safe to paste real tokens.
What is inside a JSON Web Token
A JWT is three base64url-encoded parts joined by dots:
| Part | What it holds |
|---|---|
| Header | The signing algorithm (alg, such as HS256 or RS256), the token type (typ) and often a key ID (kid). |
| Payload | The claims: who the token is about, who issued it, when it expires and any custom data. |
| Signature | A signature over the header and payload. It proves the token was issued by someone holding the key and has not been changed. |
The header and payload are only encoded, not encrypted. Anyone with the token can read them, so never put passwords or secrets in a JWT payload.
Registered claims
| Claim | Meaning |
|---|---|
| iss | Issuer: who created and signed the token |
| sub | Subject: the user or entity the token is about |
| aud | Audience: the service the token is meant for |
| exp | Expiration time, in seconds since 1 January 1970 UTC |
| nbf | Not before: the token is not valid until this time |
| iat | Issued at: when the token was created |
| jti | JWT ID: a unique ID, used to stop a token being replayed |
How to verify a JWT signature
- HS256, HS384, HS512 use one shared secret. Paste it under Secret; tick the box if your secret is stored base64 encoded.
- RS256, PS256, ES256 and the other asymmetric algorithms are signed with a private key and checked with the public key. Paste the PEM public key (
-----BEGIN PUBLIC KEY-----) or a JWK, such as one entry from your identity provider's JWKS endpoint. - A green "Signature verified" means the token was signed with that key and has not been changed. Your server should also check
exp,nbf,issandaud. - Never accept
alg: none. A token with no signature can be written by anyone.
How to create a JWT
Switch to Encode, pick an algorithm, edit the header and payload JSON, and enter a secret or a PKCS#8 private key (-----BEGIN PRIVATE KEY-----). The signed token updates as you type. The buttons add iat for now or an exp one hour, one day or 30 days ahead. Use this for testing; production tokens should be issued by your server.
Common JWT problems
- 401 with a token that decodes fine: check
expand the server clock, thenaudandiss. - Invalid signature with the right secret: the secret may be base64 encoded on the server, or the token was copied with a missing character.
- Five parts instead of three: it is an encrypted JWE, which cannot be read without the decryption key.