Toolstia / JWT decoder
JWT decoder
A JSON Web Token looks like three blocks of random characters joined by dots, but two of those blocks are just encoded JSON. This decoder opens them for you: paste a token and you see the header, the payload, and a readable list of any issued-at, not-before and expiry times, together with a note on whether the token is currently valid by its own dates.
It is meant for debugging sign-in problems, checking which claims an identity provider put in a token, and finding out why an API returns 401. Decoding does not need a secret, which also means it proves nothing about authenticity: the signature is displayed but never verified, so treat what you read as claims that still have to be checked by your server.
The token is decoded in your browser and is not sent anywhere. Even so, avoid pasting live production tokens into any website.
How it works
- Paste the token. A leading "Bearer " is fine.
- Read the header and payload.
- Check the dates and the expired notice.
What a JWT is
A JWT has three parts separated by dots: a header, a payload and a signature. The header and payload are just JSON written in Base64URL, which is why anyone can decode them without a key.
Decoding is not verifying
This tool does not check the signature, because that needs the secret or public key. A token that decodes cleanly may still be forged, so your server must verify it before trusting any claim.
Common claims
sub is the subject, usually a user ID. iss is the issuer. aud is the audience. iat is when it was issued, nbf is the time before which it is not valid, and exp is when it expires. The dates are Unix times in seconds.
Handle tokens with care
A live token can act like a password. This page decodes it in your browser without sending it anywhere, but you should still avoid pasting production tokens into websites you do not control.
A token read line by line
The sample token begins with a header that decodes to alg HS256 and typ JWT. Its payload decodes to sub 1234567890, name John Doe and iat 1516239022. The tool converts that last number to 2018-01-18 01:30:22 UTC. This token has no exp claim, so no expired or valid notice is shown.
Now consider a token with iat and nbf of 1700000000 and exp of 1700003600. The tool lists them as 2023-11-14 22:13:20 UTC for issued and not-before, and 23:13:20 UTC for expiry. The difference between exp and iat is 3600 seconds, so this token lives for one hour.
How the validity message is decided
If the payload has a numeric exp and it is earlier than the current time on your device, the page says the token has expired. If exp is still ahead, it says the token has not expired. If a numeric nbf is in the future, the page instead says the token is not valid yet, and that message takes priority.
Only exp, nbf and iat are checked and converted. Claims such as aud, iss and custom roles are shown in the payload but not judged. Because the comparison uses your device clock, a computer with the wrong time can produce a wrong verdict.
Seconds, not milliseconds
JWT time claims are Unix timestamps in seconds. Some code writes milliseconds by mistake, and a value like 1700003600000 will be displayed as a date many thousands of years away. If the dates look absurd, the token was probably created with milliseconds.
A related trap is clock skew between servers. A token that is rejected as not yet valid seconds after being issued often means the two machines disagree about the time, not that the token is bad.
Header values worth noticing
The alg field tells a verifier how the signature was made. HS256 uses a shared secret, while RS256 and ES256 use a private key to sign and a public key to verify. A kid field, when present, identifies which key was used. A header whose alg is none describes an unsigned token, which a server must never accept as proof of identity.
This tool accepts a token with two parts as well as three, since an unsigned token can end after the second dot with an empty signature. A five-part value is an encrypted token and cannot be read here.
What this tool does not do
It does not check the signature, fetch keys, validate issuer or audience, or create tokens. It also cannot decrypt tokens. If you paste something with a leading word Bearer, that prefix is removed for you, but extra quotes or line breaks from copying out of a log may still cause an error.
Use it to understand a token, then rely on your authentication library for the real validation.
Questions
Is the token uploaded?
No. It is decoded by your browser.
Why does it say the token is invalid?
The text may be cut off, or it may not be a JWT. A JWT has three parts separated by two dots.
Can it tell me if the signature is valid?
No. Verifying needs the key, so do that on your server or with your auth library.
What time zone are the dates in?
UTC. The expiry check compares with the current time on your device.
Why does the page say a JWT has three parts?
A standard signed token is header.payload.signature. If your text has a different number of dot-separated parts it is cut off, is not a JWT, or is an encrypted token.
Can I see the signature?
The tool reads the signature part but does not display or verify it. It is binary data encoded as Base64URL, so it is not human readable anyway.
Why are some claims shown as dates and others as numbers?
Only iat, nbf and exp are time claims in the standard, so only those are converted. Other numbers are shown as they appear in the JSON.
Does an unexpired token mean it is safe to trust?
No. It means the exp date has not passed. The token could still be forged, revoked or meant for a different service.
What is the difference between an access token and an ID token?
An access token is presented to an API, while an ID token tells the app who signed in. Both may be JWTs, and this tool decodes either one the same way.