Glossary
Plain English
Cross-linked to tools

JSON Web Token

Also known as: JWT, JOSE JWT, JSON Web Token (RFC 7519)

A JSON Web Token (JWT) is a compact, URL-safe credential made of three Base64URL-encoded segments — header, payload, and signature — that an API issues so a client can prove who it is on subsequent requests without re-authenticating each time.

Overview

A JWT looks like 'xxxxx.yyyyy.zzzzz'. The first segment is a JSON header that names the signing algorithm (e.g. HS256, RS256, ES256). The second is a JSON payload of 'claims' — sub (subject), iss (issuer), aud (audience), iat (issued-at), exp (expiration), and any custom fields like role or scope. The third is a signature over the header and payload using either a shared secret (HS family) or an asymmetric key (RS / ES family). Servers verify the signature, then trust the claims.

JWTs are easy to misuse. The most common mistakes: forgetting to verify the signature, accepting the 'none' algorithm, embedding sensitive data in the payload (it is only Base64-encoded, not encrypted), and using long-lived tokens without a revocation strategy. For most user-session use cases, opaque session IDs backed by a server-side store are simpler and safer.

Common questions about JSON Web Token

Are JWTs encrypted?
Standard signed JWTs (JWS) are not encrypted — the header and payload are merely Base64URL-encoded and anyone can decode them. JWE is a separate spec for encrypted JWTs; it has five segments instead of three. Never put secrets in a signed JWT payload.
What does 'verifying a JWT' mean?
Verifying means recomputing the signature over the header+payload using the secret (HS256) or public key (RS256/ES256) and comparing it to the third segment. If it matches, the token has not been tampered with and you can trust the claims.
What is the exp claim?
exp is a Unix timestamp (seconds since epoch) for when the token stops being valid. APIs reject any JWT whose exp has passed. The most common reason an otherwise correct JWT is rejected is an expired exp.
When should I NOT use JWTs?
For typical user-session authentication on a single web app, opaque server-side session IDs are simpler and easier to revoke. JWTs shine when multiple services need to verify identity without calling a central session store — single-page apps, microservices, third-party API authentication.

Tools that work with JSON Web Token

JWT Decoder

Decode and inspect JSON Web Token claims without sending them anywhere.

Base64 Encoder / Decoder

Encode text to Base64 and decode it back, all offline.

External references