A JSON Web Token (JWT) is the little xxxxx.yyyyy.zzzzz string that authenticates most modern APIs. When something’s wrong with auth, the first move is to look inside the token — read its claims, check the expiry, confirm the signature.
This guide explains the three parts of a JWT and how to decode and verify one safely.
TL;DR — Paste a token into the JWT decoder to read its header and payload and check
exp. It runs in your browser, so your token — a credential — never leaves your device.
The three parts
A JWT has three Base64URL-encoded sections separated by dots:
- Header — the algorithm (
alg, e.g.HS256orRS256) and token type. - Payload — the claims: who the token is for and what it allows.
- Signature — a cryptographic signature over the first two parts.
The header and payload are only encoded, not encrypted. Decoding them is trivial and reveals everything inside, which is why you must never put secrets in a JWT payload.
Reading the claims
The payload holds standard registered claims:
- iss — issuer (who created the token).
- sub — subject (usually the user ID).
- aud — audience (who the token is for).
- exp — expiry, a Unix timestamp. After this, the token is invalid.
- iat — issued-at time.
- nbf — not-before time; the token isn’t valid until then.
A decoder converts exp, iat and nbf to human time and flags whether the token is active, expired, or not yet valid — usually the answer to “why is my auth failing?”.
Decoding vs. verifying
Decoding reads the claims. Verifying proves they can be trusted. Without verification, anyone can craft a token with any claims they like — decoding alone tells you nothing about authenticity.
- HS256 (HMAC) tokens are verified with a shared secret. Given the secret, the decoder recomputes the signature and confirms it matches.
- RS256 / ES256 tokens are signed with a private key and verified with the matching public key. The decoder can read them, but verification needs that public key.
Your application must always verify the signature server-side before trusting a token’s claims.
Keep the token private
Because a JWT is a credential, where you decode it matters. Many online decoders transmit whatever you paste. The JWT decoder here decodes and verifies entirely in your browser — nothing is uploaded, so it’s safe for real tokens.