
A JSON Web Token, or JWT, is a compact string that applications use to carry a signed set of claims, such as who a user is and when a login expires. It looks like three blocks of random characters separated by dots, but two of those blocks are only encoded JSON. The tool below decodes them for you so you can read the header, the payload and the signature while you debug a login or an API call. It runs in your browser, so the token you paste is not sent anywhere.
JWT decoder
Paste a JSON Web Token to read its header and payload. It decodes the token; it does not check the signature.
This token has expired.
Issued at (iat)
2018-01-18T01:30:22.000Z
Expires at (exp)
2018-01-18T02:30:22.000Z
The signature is not verified here. Anyone can write a token that decodes; only your server's key can tell whether it is genuine.
What you enter never leaves your browser. Nothing is sent or stored.
How to use the decoder
- Paste the token into the input field. A token has the form
header.payload.signature. - Press Decode.
- Read the three parts. The header and the payload are shown as formatted JSON. The signature is shown as it appears in the token.
If the text does not look like a token, the tool says the token is invalid. Do not paste a token you must keep secret into any tool you do not trust. This one processes it in the page, but a token is a credential, so treat a live production token with care and prefer a test token when you can.
What the three parts contain
- Header. Says which algorithm signed the token, for example
HS256orRS256, and usually that the type isJWT. - Payload. The claims. Common ones are
sub(the subject, often a user id),iss(the issuer),aud(the audience),iat(issued at) andexp(expiry). The time claims are Unix timestamps in seconds. - Signature. A value computed from the header, the payload and a secret or a private key. It lets the receiving server check that nobody changed the token.
Decoding is not verifying
This is the point most worth remembering. Anyone can decode a JWT, because the header and payload are only Base64URL-encoded, not encrypted. The decoder shows you what is inside; it does not check the signature and cannot tell you the token is genuine. Only a server that holds the right key can verify it.
Two consequences follow. First, never put a secret in a JWT payload unless the token is also encrypted. Second, never trust the contents of a token on the client side to make a security decision. The server must verify the signature and the claims every time.
Mistakes in handling tokens
- Skipping signature verification. A server that only decodes the payload will accept a forged token.
- Accepting any algorithm. Verify against the algorithm you expect, and reject
none. - Ignoring `exp`, `aud` and `iss`. A valid signature on an expired token, or a token meant for another service, should still be refused.
- Long-lived tokens in local storage. Keep lifetimes short, and think about where a token is stored and what script can read it.
- No way to revoke. A token is valid until it expires. Plan for rotation and revocation before you need it.
When this is more than a debugging step
Authentication and token handling are easy to get almost right. If you are building or reviewing the login and API layer of an application, application security is the work we do on exactly this, and web application development covers building it in.
Frequently asked questions
Does the token leave my browser?
No. It is decoded in the page on your device. The tool makes no network request with it and does not store it.
Can I tell from the decoded token whether it is valid?
You can read the expiry and the other claims, but you cannot confirm the signature. Only a server with the key can do that.
What does the `exp` value mean?
It is the expiry time as a Unix timestamp in seconds. Convert it to a date with a timestamp converter to see when the token stops working.
Why does the decoder say my token is invalid?
A JWT needs at least a header and a payload separated by a dot, and each must be valid Base64URL. A truncated copy, an extra space or a token with a Bearer prefix left on are the usual causes.
Related services
Where this topic becomes an engagement.
Keep reading
The articles that follow this one.



