Reading a JWT: What's Inside the Token

Reading a JWT: What's Inside the Token

You’ve seen them in browser dev tools: eyJhbGciOi... — a long string that carries your login session. That’s a JWT (JSON Web Token), and contrary to how it looks, anyone can read most of it.

The three parts

A JWT is three base64-encoded sections joined by dots:

header.payload.signature
  • Header — metadata: which algorithm signed the token (HS256, RS256…).
  • Payload — the claims: who you are (sub), when the token expires (exp), your roles and permissions.
  • Signature — cryptographic proof that the token wasn’t tampered with.

The header and payload are base64url-encoded JSON, not encrypted. Decoding them is a display operation, not a hack — which is why the payload must never contain secrets.

What decoding tells you

Paste a JWT into the JWT decoder and you’ll see:

  • Who issued it (iss) and who it’s for (aud).
  • When it expires (exp is a Unix timestamp — paste it into the timestamp converter to read it as a date).
  • What the token holder can do — roles and scopes are usually right there.

For developers, this is the fastest way to debug “why is my token rejected”: check exp for expiry, aud for the wrong service, iss for the wrong issuer.

The critical caveat

Decoding is not validating. Anyone can create a JWT with "admin": true in the payload — the signature is what makes the real one trustworthy, and verifying it requires the secret key. Never trust a token’s claims because they say so; trust the signature check your server performs.

A JWT is a glass envelope: you can read the letter without opening the seal. The seal is what matters.