🔑 JWT Decoder

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.

🔒 Runs entirely in your browser — token never sent to any server
Paste JWT Token
 
Understanding JWTs
🔓
JWTs are not encrypted
The header and payload are only Base64URL-encoded — anyone who holds the token can read them. Never store passwords, secrets, or PII in a JWT payload.
✍️
Signed, not secret
The signature proves the token hasn't been tampered with, but it does not hide the content. Use HTTPS to protect the token in transit; use short expiry to limit blast radius if stolen.
⏱️
Check expiry (exp claim)
The exp claim is a Unix timestamp. This decoder tells you exactly when a token expires — useful when debugging "401 Unauthorized" errors from APIs.
🔑
Algorithm matters
Prefer RS256 (asymmetric) over HS256 (shared secret) for production APIs. RS256 lets you verify tokens publicly without exposing the signing key.
Frequently asked questions
What are the three parts of a JWT? +

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.

Can I verify a JWT signature with this tool? +

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.

What is the difference between HS256 and RS256? +

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.

How do I invalidate a JWT before it expires? +

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.

Where should I store a JWT in the browser? +

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.