Paste a JSON Web Token to decode its header, payload, and check its expiry. Everything runs in your browser — your token never leaves your device.
exp claim is a Unix timestamp. This decoder tells you exactly when a token expires — useful when debugging "401 Unauthorized" errors from APIs.A JWT has three Base64URL-encoded segments separated by dots: the Header (algorithm and token type), the Payload (claims — user data, expiry, issuer), and the Signature (a hash of header + payload signed with a secret or private key). Only the signature proves authenticity; the other two are just encoded JSON readable by anyone.
This tool decodes the header and payload for inspection but does not verify the signature — that requires the secret key or public certificate used to sign it. Signature verification should always happen server-side. Use this decoder to read claims, check expiry, and debug token structure.
HS256 uses a single shared secret for both signing and verification — both the issuer and every verifier must know the secret. RS256 uses an asymmetric key pair: the issuer signs with a private key, and anyone can verify with the public key. RS256 is safer for multi-service architectures because verification does not require exposing the signing key.
JWTs are stateless by design — there is no built-in revocation. Common strategies: use very short expiry (5–15 minutes) paired with a refresh token; maintain a server-side blocklist of revoked JTI (JWT ID) values; or rotate the signing key to invalidate all existing tokens at once. Each approach has trade-offs between security and performance.
The two main options are localStorage (easy, but vulnerable to XSS) and httpOnly cookies (not accessible to JavaScript, safer for sensitive tokens). For most production apps, httpOnly cookies with SameSite=Strict or SameSite=Lax is the recommended approach.