Dev Tools

Debugging a Login Issue by Reading What's Actually Inside a JWT

A JWT (JSON Web Token) looks like a long, meaningless string of random characters — until you decode it, at which point it turns out to be a structured, readable piece of data the whole time. When you're debugging an authentication issue, being able to read what's actually inside a token is often the fastest way to figure out what's actually going wrong.

What's actually inside a JWT

A JWT has three parts, separated by dots: a header (describing the token type and signing algorithm), a payload (the actual claims — data like a user ID, an expiration time, or custom fields your system added), and a signature (which verifies the token wasn't tampered with). The header and payload are just Base64-encoded JSON — not encrypted, not hidden, just encoded in a way that isn't human-readable without decoding it first.

Why decoding helps with debugging

A lot of authentication bugs come down to something specific in the token's claims — an expiration time that's already passed, a user ID that doesn't match what's expected, a custom field that wasn't set correctly during login. Decoding the token turns "authentication is broken, somehow" into "the expiration timestamp is set to the wrong value," which is a debuggable problem instead of a mystery.

  1. Paste the JWT.
  2. The header and payload decode instantly into readable, syntax-highlighted JSON.
  3. Check the specific claim you're investigating — expiration, user ID, custom fields.

The critical thing decoding does not prove

This is worth being explicit about: decoding a JWT only reveals its contents — it does not verify the signature, and therefore does not confirm the token is authentic or hasn't been tampered with. A token can decode perfectly cleanly and still be invalid, expired past what your system should accept, or entirely fabricated. Decoding is for reading a token's claims while debugging; actually validating a token's authenticity is a separate step your authentication system handles, not something decoding alone proves.

A quick note on sensitive data

Since a JWT's payload is just encoded, not encrypted, anyone who has the token can decode and read its contents — which is worth remembering if a token happens to contain anything sensitive. Decoding one to debug your own system is fine; treating a JWT's contents as private or hidden is a mistake some systems make.

Debugging an auth issue right now? Try the JWT Decoder — decoding happens entirely in your browser, your token is never uploaded to a server.

Try the tool JWT Decoder Decode JWT header and payload — no signature verification