What a JWT shows you — and what it cannot prove
A JWT payload is base64url, not encryption. What the three segments hold, why decoding is not verification, and how exp and server-side checks actually work.
2026-12-04
Three segments, one readable payload
A JWT is three base64url strings joined by dots: header.payload.signature. The header names the algorithm and often a key id, the payload carries claims such as sub, iss and exp plus anything the issuer chose to add, and the signature is the part a verifier can recompute. The first two segments are text inside a wrapper, nothing more.
Base64url is an encoding, not encryption. Anyone holding the token can decode the payload in a second and read every claim in clear text. Treat the payload as public: it may hold a user id, a role, a plan name or an email, and all of that is visible in the browser, in a screenshot of the network panel, and in every proxy log that records the Authorization header. Secrets belong in a server-side session store, not in a claim.
Base64url is not base64, and decoding is not checking
Standard base64 uses + and / and pads the end with =. Base64url swaps those characters for - and _ so the string survives URLs and file names, and JWT drops the padding entirely. A decoder maps - back to +, _ back to / and re-adds = before decoding. That is why a token copied out of a URL works, while one truncated by a chat client may not.
A successful decode proves only that the bytes were valid base64url and that the payload parsed as JSON. It says nothing about who issued the token. Change one character in the payload and re-encode it, and the decoder will happily show your forged claims next to the original signature; the mismatch appears only when someone recomputes the signature with the right key. Never let "it decoded" turn into "it is valid".
exp, iat and nbf are Unix seconds
Time claims are integers counting seconds since 1970-01-01 00:00 UTC. A payload of {"sub":"1234","exp":1767225600} expires at 2026-01-01 00:00:00 UTC. Multiply by 1000 for JavaScript's Date; the same digits treated as milliseconds (1767225600000) are a completely different date, which is a common bug when a producer writes milliseconds into a seconds field.
Real clocks drift. A server that rejects a token 30 seconds early because its clock is behind, or accepts an expired one because it is ahead, needs a small leeway on exp and nbf, often 30 to 60 seconds. The expiry shown in a decoder is a hint based on your local clock, not an authoritative check. The resource server must still verify the signature and the time window on every request; a browser that hides an expired token protects nobody.
HS256 shares a secret; RS256 and ES256 do not
HS256, HS384 and HS512 are HMAC: the issuer and the verifier hold the same secret, and the signature is computed over header.payload. RS256 and ES256 are asymmetric: the issuer signs with a private key and publishes a public key, usually through a JWKS endpoint, so any verifier can check without being able to mint tokens. That difference decides what a browser tool can honestly do.
A page can offer HS verification because you paste the shared secret and it never leaves the tab. It cannot verify RS256 or ES256 without the issuer's public key, and it has no safe way to fetch and trust an arbitrary JWKS from a random URL. A token with alg set to none has no signature at all; a verifier that accepts it has a bug, and so does one that lets the token choose between HS256 and RS256 with the public key used as the HMAC secret.
Where tokens leak
Storing an access token in localStorage makes it readable by any script on the page. One injected script — a compromised dependency, an ad, a browser extension with page access — can read it and send it elsewhere, and the token keeps working until it expires. An httpOnly, Secure cookie is not immune to CSRF, but it removes the simplest exfiltration path and is the usual choice for session tokens.
Tokens also leak through places people forget: request logs that record full URLs, analytics that capture query strings, screenshots in a support ticket, a token pasted into a chat to ask why something fails, and browser history when the token rode in a query parameter. When you debug, redact the signature and the middle of the payload, and treat any token that appeared in a screenshot as compromised — rotate it rather than hoping nobody looked.
A workable inspection routine
Start with JWT Decoder: it splits the three segments locally, formats header and payload as JSON, converts exp, iat and nbf into readable dates and flags a token that is already expired. For HS256/384/512 you can paste the secret and it checks the signature with Web Crypto inside the tab; for RS256 and ES256 it reports the algorithm as unsupported, which is honest rather than a silent pass.
Use the neighbours for the surrounding work: JSON Formatter to read a large claims object, Hash Generator to reproduce a digest by hand, and Base64 Image Encoder when the base64 in front of you is a picture rather than a token. The rule that matters is the split between reading and trusting: decoding tells you what a token claims, and only signature plus time checks against the issuer's key tell you whether to believe it.