How to Read a JWT Without a Library

By the ToolPocket team · Updated 2026-12-05 · Editorial standards

A JWT looks opaque, but two of its three parts are just Base64URL-encoded JSON. Knowing that makes debugging sessions and API errors much easier.

A JSON Web Token is three strings joined by dots: header.payload.signature. Each part is Base64URL, a variant of Base64 that replaces + with - and / with _ and drops padding.

The header

The first segment decodes to JSON describing the token: the signing algorithm (alg) and the token type (typ). A typical value is {"alg":"HS256","typ":"JWT"}. The algorithm matters: none means no signature at all, and accepting it is a well-known vulnerability.

The payload

The second segment holds the claims. A few standard ones:

The signature

The third segment is not readable as JSON. It is the signature over the first two segments, produced with a secret (HMAC) or a private key (RSA, ECDSA). Checking it requires the key; decoding the payload does not.

Decoding is not verification

Anyone can decode a token and edit the payload. A server must verify the signature before trusting a single claim. Client-side code should treat a decoded payload as a hint, never as proof of identity.

Practical checks

Common JWT mistakes

Paste any token into the JWT decoder to inspect it. The decoding happens locally, but still avoid using production tokens on sites you do not control.

← All guides