A login flow breaks and the token sits in the middle of the argument looking like a string of noise. Most of these failures are not exotic. They come from a short list of mistakes that repeat across projects: the token expired, the wrong or damaged token got pasted somewhere, somebody trusted the payload as proof, or two clocks disagreed by a minute and everyone read the verdict wrong.
This guide works through those mistakes in the order worth checking them, and shows what the JWT Decoder on Ovatly can and cannot settle for each one.
Contents
- Quick answer
- Mistake 1: the token simply expired
- Mistake 2: the wrong token, or a truncated one
- Mistake 3: trusting the payload as proof
- Mistake 4: misreading clock skew
- How to run the checks, step by step
- Worked example: the classic demo token under each check
- Limitations: the decoder cannot verify signatures
- Common mistakes
- FAQs
- Conclusion
Quick answer
When a JWT-based login breaks, check four things first. One, the expiry: paste the token into the JWT Decoder and read the verdict, because an expired token is the most common cause. Two, the paste itself: a truncated or wrong token fails to decode, which tells you the problem is the copy, not the claims. Three, your assumptions: a decoded payload is a claim, not a proof. Four, the clocks: some systems allow a minute or two of skew leeway, so a token can read as expired in the decoder while a server still accepts it. The one thing the decoder will never tell you is whether the signature is valid. It cannot verify signatures, and it says so on the page.
Mistake 1: the token simply expired
Expiry is the dullest cause and the most frequent. The exp claim holds seconds since the Unix epoch, and once that moment passes, a server that enforces expiry rejects the token. The failure looks dramatic from the user's side, but the token is doing exactly what it was issued to do.
The decoder makes this check trivial. It translates exp into a readable date and gives an expired or not-expired verdict, so you never have to convert epoch seconds in your head. If the verdict says expired, the fix is on the issuing side: get a fresh token. If it says not expired, expiry is ruled out in seconds and you move down this list.
Mistake 2: the wrong token, or a truncated one
The second cause never reaches the claims at all. Tokens are long, and they get copied badly: a selection that misses the final characters, a chat window that wraps and eats a segment, an old token pasted from a stale note. A JWT is three dot-separated parts, and the decoder needs all three.
This failure is actually informative. If the token will not decode, the problem is the copy, and there are no claims to read. Re-copy the token from its source, and check that both dots are present and nothing was added at either end. Reading the subject claim also catches the wrong-token case: the paste decodes fine, but names somebody else.
Mistake 3: trusting the payload as proof
This is the mistake with real consequences. The header and payload of a JWT are encoded, not encrypted, and anyone holding the token can read them. A decoded payload is a claim, not a proof. Anyone can assemble a token claiming any subject, any issuer and any expiry, sign it with a key they invented, and it will decode into clean JSON.
Only one thing separates that forgery from a genuine token: the issuing server verifying the signature against the real signing key or the issuer's public key. Login flows break when some part of the system skips that check and acts on claims it merely read. Hold the same line when you debug: the claims tell you what the token says, never that the token is genuine.
Mistake 4: misreading clock skew
The fourth cause is a disagreement about what time it is. The decoder reports the exp claim exactly, translated into a date and judged against the current time. Some systems allow clock skew leeway of a minute or two, forgiving small clock differences. Some ignore exp for specific flows entirely.
So a token can read as expired in the decoder while an app still accepts it, because the server's leeway covers the gap. The reverse happens too: the verdict looks wrong near the boundary, when really the server's clock or policy differs. The tool reports the claim exactly; your server's policy decides what is enforced. When verdict and behaviour disagree, believe both, and go read the server's leeway settings.
How to run the checks, step by step
- Open the JWT Decoder and paste the full token, all three dot-separated parts. If it will not decode, fix the copy first.
- Read the decoded header, which names the algorithm and token type.
- Read the payload claims: subject, issuer, issued-at and expiry. Confirm the subject is the user you expect.
- Check the expiry panel for the verdict, and remember the signature warning: the signature is present but not verified, so a clean read never proves the token genuine.
Worked example: the classic demo token under each check
Run the well-known demo token through the list. Its header is {"alg":"HS256","typ":"JWT"} and its payload contains sub "1234567890", name "John Doe" and iat 1516239022. It decodes cleanly, so mistake 2 is ruled out: the copy is whole. The subject claim reads 1234567890, which either matches the account you are debugging or exposes a wrong-token problem.
The example token carries no exp claim of its own, so the panel reports no expiry rather than a verdict. Add an exp claim of 4000000000 and the tool reports expiry on 2 October 2096, so the token is not expired, and mistake 1 is ruled out for that version. And mistake 3 is the standing warning on the page itself: the signature is labelled not verified, and the payload remains a claim until a server checks it.
Limitations: the decoder cannot verify signatures
State it plainly: this tool cannot verify that a token is real. Verification needs the signing secret or public key, which a decoder page does not have. The tool decodes and labels the signature as not verified, and you should be suspicious of any decoder that implies it can do more.
That limit shapes what debugging here can conclude. The decoder can prove a token is expired, malformed or naming an unexpected subject. It cannot prove a token is genuine, unrevoked or accepted by any particular server, because those decisions live with the issuer and its keys. Everything happens locally in your browser, since tokens are credentials and the page never uploads the one you paste, so these checks are safe to run on a real login token.
Common mistakes
- Converting epoch times by eye. exp and iat are seconds since the Unix epoch. Let the decoder translate them; guessing invites off-by-hours errors.
- Treating a decoded payload as proof. It is a claim. Only the issuer's signature verification makes it proof, and the decoder does not perform it.
- Arguing with the verdict at the boundary. A minute or two of clock skew leeway is normal. If the decoder and the server disagree slightly, the server's policy explains it.
- Pasting tokens into unknown sites. A decoder that uploads your token has your credential. Use one that runs locally, and keep tokens out of screenshots.
FAQs
Why does my app reject a token that decodes perfectly? Because decoding is not verification. The token may decode beautifully while its signature fails the server's check, or the server may have revoked it. The decoder shows the claims and labels the signature as not verified; it cannot reproduce the server's decision.
Why does the decoder say expired when the app still accepts the token? Some systems allow clock skew leeway of a minute or two, and some ignore exp for specific flows. The tool reports the claim exactly; your server's policy decides what is enforced.
Why will my token not decode at all? Usually the paste is damaged: a segment is missing, the token was truncated when copied, or extra characters came along. The decoder needs the full token, all three dot-separated parts, exactly as issued.
The payload names the wrong user. Does that prove the token is forged? It proves only that the payload makes that claim. A decoded payload is a claim, not a proof, and anyone can write any payload they like. Whether the token is genuine is settled by signature verification on the server, not by reading it.
Is it safe to paste a real login token into the decoder? The decoding runs entirely in your browser and nothing is sent anywhere. Still, treat tokens like passwords generally: do not post them in public places or screenshots.
Conclusion
Broken login flows usually trace back to one of four things: an expired token, a damaged paste, a payload trusted further than it should be, or a minute of clock skew. The JWT Decoder settles the readable parts of that list in seconds and is explicit about the one part nobody can read their way to: signature verification. The companion guide covers the tokens that never expire at all: What Does It Mean When a JWT Has No Expiry. More tools for this kind of debugging live in the Developer Tools archive.