Forgebox
← All guides

Guide · Updated 2026-11-30

JWT Explained: Header, Payload, and Signature

A clear walkthrough of JWT structure, claim checking, expiry, and why decoding a token is never the same as verifying it.

Related tool: JWT Decoder

Three parts of a token

A JWT usually has header, payload, and signature sections separated by dots. The header describes the algorithm and token type. The payload often includes subject, expiry, issuer, audience, and custom claims your app defines.

Because the payload is only encoded, not encrypted, anyone who obtains the token can read those claims. Never put passwords or highly sensitive secrets in JWT payloads.

Decode locally, verify properly

Decoding helps debugging: you can confirm claim names, expiry timestamps, and whether you are looking at an access token or an ID token. Verification proves integrity and trust using keys and algorithm checks. Never confuse the two.

Prefer short-lived access tokens, rotate secrets, and reject surprising algorithms. In production verifiers, explicitly allow only the algorithms you intend to use.

Use Forgebox JWT Decoder for local inspection of sample tokens while building or troubleshooting auth flows. It is a visibility tool, not a substitute for server-side verification.

Claims worth checking every time

At minimum, validate expiry (exp), not-before (nbf) if present, issuer, and audience. Then apply your application rules: roles, tenant IDs, and scopes.

Clock skew between servers can cause intermittent failures. Small leeway is common; large leeway hides real configuration problems.