JWT Decoder
Decode and inspect JSON Web Tokens (JWT) instantly. Free, private, no signup.
💻 Developer Tools
Free
Browser-based
JWT Structure Explained
A JWT (JSON Web Token) has three dot-separated parts, each independently Base64url-encoded: header.payload.signature. The payload is readable by anyone — it is encoded, not encrypted. Only the signature proves the token was issued by someone who knew the secret, and signature verification requires the key. This tool decodes the header and payload for inspection without needing the key.
- Header — specifies the token type (
JWT) and the signing algorithm (HS256,RS256,ES256, etc.). - Payload — contains claims: registered claims (
iss,sub,exp,iat) and custom application claims. - Signature — the HMAC or RSA/ECDSA signature over the encoded header and payload. Verification requires the secret key or public key.
Common JWT Claims
| Claim | Full name | Meaning |
|---|---|---|
iss | Issuer | Who issued the token (e.g. your auth server URL) |
sub | Subject | Who the token is about — usually a user ID |
aud | Audience | Intended recipient — the API or service that should accept it |
exp | Expiration | Unix timestamp when the token expires; reject tokens past this time |
iat | Issued at | Unix timestamp when the token was created |
nbf | Not before | Token must not be accepted before this time |
jti | JWT ID | Unique identifier — used to prevent replay attacks |
JWT vs Session Tokens
| JWT (stateless) | Session token (stateful) | |
|---|---|---|
| Storage | Client stores the full token | Server stores session data; client has a session ID |
| Revocation | Difficult — token valid until expiry | Easy — delete session from the server |
| Scalability | Works across multiple servers without shared state | Requires shared session store (Redis, DB) for multiple servers |
| Payload size | Grows with every claim added | Fixed — just a session ID string |
JWT Security Best Practices
- Set a short expiry (
exp) — access tokens should typically expire in 15–60 minutes. Use refresh tokens for longer sessions. - Never put sensitive data in the payload — the payload is Base64-encoded, not encrypted. Anyone with the token can read it.
- Verify the signature server-side — never trust a JWT that has not been verified against the secret or public key.
- Use HTTPS always — a JWT in an HTTP request is exposed to anyone who can intercept the connection.
- Reject the
alg: noneattack — ensure your library does not accept tokens with the algorithm set tonone.