Home/Glossary/JSON Web Token (JWT)

JSON Web Token (JWT)

A compact, URL-safe token format used to securely transmit claims between parties in web applications.

Web SecurityAlso called: "jwt", "bearer token"

JWTs consist of three parts: header, payload, and signature, separated by dots.

Structure

  • Header: Algorithm and token type.
  • Payload: Claims about the user or session.
  • Signature: Cryptographic verification using a secret key.

Security considerations

  • Never store sensitive data in the payload (it's base64-encoded, not encrypted).
  • Validate signatures on every request to prevent tampering.
  • Set short expiration times and implement refresh token rotation.
  • Use strong signing algorithms (RS256, ES256) over HS256 when possible.