Skip to main content
Bethemesh
GuideBest practices

JWT: understand structure, signature, expiration and common mistakes

Learn what a JWT contains, why decoding is not verification, how claims such as exp, nbf, iss and aud work, and common security mistakes.

Published 29 August 2026Reading : 1 minBy Bethemesh Team
Beginner
Show contents
  1. Decoding is not verification
  2. Validate more than the signature
  3. Keep sensitive data out of the payload
  4. Storage and sessions still matter

A JSON Web Token commonly contains three Base64URL-encoded parts: header, payload and signature. The payload is readable; a signed JWT is generally not encrypted.

Decoding is not verification

Anyone holding a JWT can decode its header and payload. That says nothing about whether the signature is valid or whether the issuer should be trusted. Use the JWT decoder to inspect structure and the JWT inspector to reason about claims, but verification belongs to trusted application code with the expected key and algorithm.

Validate more than the signature

Check expiration (exp) and, when used, nbf, issuer (iss) and audience (aud). Reject algorithms your application did not explicitly choose. Never let untrusted token metadata silently redefine verification rules.

Keep sensitive data out of the payload

Because the payload is readable, do not treat it as a secret store. Minimize claims and avoid unnecessary personal or confidential data.

Storage and sessions still matter

A valid token can still be stolen. Browser storage choices, cookie attributes, XSS defenses, token lifetime, refresh strategy and revocation requirements all affect risk. JWT is a token format, not a complete session architecture.

The JWT encoder is useful for learning and controlled workflows; production issuance and verification should remain server-side and policy-driven. Pair token design with sound password practices and authorization checks on every protected action.

Related tools

Security & privacy

JWT decoder

Decode a JWT to inspect its header, payload, and main token information more easily.

100% local
Use this tool
Security & privacy

JWT inspector

Inspect a JWT to review its header, payload, timestamps, and main token information.

100% local
Use this tool
Security & privacy

JWT Encoder

Create a locally signed JWT with HS256, HS384, or HS512.

100% local
Use this tool

Collection

Secure a website

  1. 01Web security: understand the essential protections of a website
  2. 02Content Security Policy (CSP): reduce XSS risks and unwanted loads
  3. 03HTTP security headers: which ones to enable and why
  4. 04Subresource Integrity (SRI): verify external resource integrity
  5. 05JWT: understand structure, signature, expiration and common mistakes
  6. 06Passwords: generation, strength and useful policies
  7. 07Hashes, integrity and fingerprint comparison: what a hash can really prove

Was this article useful?