What is a JWT and what is inside it

November 2026 · 4 min read

A JSON Web Token is three Base64URL-encoded parts joined by dots: header.payload.signature. It is a compact way to carry claims between parties, and it is everywhere in modern APIs.

Header

The header is a small JSON object. It names the signing algorithm and the token type:

{"alg":"HS256","typ":"JWT"}

The alg field matters. If a server trusts the algorithm from the token instead of enforcing its own, an attacker can try "alg":"none" or swap RS256 for HS256. This class of bug is old and still appears in the wild.

Payload

The payload holds claims: who the token is about, who issued it, when it expires. Registered names are short: sub, iss, exp, iat, aud.

Two things surprise people. First, the payload is not encrypted — anyone holding the token can read it. Second, exp is a Unix timestamp and must be checked by the server; the token will not expire by itself.

Signature

The signature protects integrity, not confidentiality. It proves the token was produced by someone with the key, and that the header and payload were not modified. It says nothing about whether the claims are true.

Decoding is not verification

Our JWT tool decodes the header and payload in your browser. That is useful for debugging, and dangerous if you treat the result as trusted. A valid-looking token with a payload you like is still just a string until the signature is verified with the right key, and the claims are checked: issuer, audience, expiry, and the algorithm.

Practical checklist