A JSON Web Token (JWT) is an open standard (RFC 7519) for securely transmitting information between parties as a compact, URL-safe JSON object. JWTs are commonly used for authentication, authorization, and information exchange in modern web applications, APIs, and single sign-on (SSO) systems.
header
Contains the token type and signing algorithm (e.g., HS256, RS256, ES256).
{"alg": "HS256", "typ": "JWT"}payload
Contains claims: registered (iss, exp, sub), public, and private claims.
{"sub": "user123", "exp": 1699999999}signature
Cryptographic signature that verifies the token hasn't been tampered with.
HMACSHA256(base64(header).base64(payload), secret)