Skip to content
uencoder

JWT

JWT (JSON Web Token) is a compact, self-contained token that securely conveys claims as a JSON object, widely used for stateless authentication and information exchange.

Purpose

It passes authentication information between stateless services, eliminating server-side session storage.

Mechanism

It has three parts—Header (algorithm).Payload (claims).Signature—all Base64URL-encoded. The signature uses HMAC or RSA, and verifying it guarantees integrity. Claims include iss (issuer), exp (expiry), and sub (subject). The token is not encrypted; keep sensitive data out of the payload.

Use cases

  • Stateless API authentication
  • OAuth 2.0 tokens
  • SSO cross-domain identity transfer
  • Service-to-service authentication

Examples

  • Input
    header.payload.signature
    Output
    Read the payload after verifying the signature

    Base64URL plus signature

Common errors

Placing sensitive data in the payload (it is only Base64, not encryption)
Keep only non-sensitive claims in the payload

Related terms

Related tools

Related tutorials

References