How to use the JWT decoder
- Paste the token. A leading "Bearer " is removed for you.
- Press Decode to see the header and payload as formatted JSON.
- Check the status line for expiry, and the dates for exp (expires), iat (issued at) and nbf (not before).
Everything runs in your browser. Nothing you type is sent to our servers. The token is not saved. Even so, treat a live token like a password: anyone who has it can use it until it expires.
What is inside a JWT
A JWT has three parts separated by dots: a header, a payload and a signature. The header and payload are JSON encoded with base64url, which is an encoding, not encryption. Anyone can read them, which is why a JWT should never carry passwords or other secrets.
The signature is made from the header and payload with a secret (HS256) or a private key (RS256, ES256). It proves who issued the token and that it has not been changed, but only to someone who checks it with the right key. This tool shows the signature and does not verify it, because that needs your key, which should stay on your server.
| Claim | Meaning |
|---|---|
| iss | Issuer: who created the token |
| sub | Subject: usually the user ID |
| aud | Audience: which service the token is for |
| exp | Expiry time, in seconds since 1 January 1970 (UTC) |
| nbf | Not before: the token is not valid until this time |
| iat | Issued at |
| jti | A unique ID for the token, used to revoke it |
Verifying a token properly
In your application, use a maintained library to verify the signature and the claims together, and tell it which algorithm to expect. Do not accept tokens whose header says alg is none, and do not let the token choose its own algorithm. The tool flags alg none when it sees it.
import { jwtVerify } from "jose";
const secret = new TextEncoder().encode(process.env.JWT_SECRET);
const { payload } = await jwtVerify(token, secret, {
algorithms: ["HS256"],
issuer: "https://auth.example.com",
audience: "my-api",
});When you would use it
- Finding out why an API returns 401: an expired token, the wrong audience or a missing scope.
- Checking which claims your identity provider puts in its tokens.
- Confirming the expiry time your login service sets.
Frequently asked questions
Does "Not expired" mean the token is valid?
No. It only means the exp time has not passed. A token is valid only when its signature is verified with the right key, which this tool does not do.
Can I decode a JWT without the secret?
Yes. The header and payload are only base64url encoded, so anyone can read them. The secret is needed to create or verify the signature, not to read the contents.
Why does my token have five parts?
That is an encrypted JWT (JWE). Its payload is encrypted, so it cannot be read without the decryption key. This tool decodes signed tokens (JWS), which have three parts.
What time zone are the dates in?
JWT times are seconds since 1 January 1970 in UTC. The tool shows them in your computer's local time.