🔑

JWT Decoder

Decode and inspect JSON Web Tokens (JWT) instantly. Free, private, no signup.

💻 Developer Tools Free Browser-based
Tool

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

ClaimFull nameMeaning
issIssuerWho issued the token (e.g. your auth server URL)
subSubjectWho the token is about — usually a user ID
audAudienceIntended recipient — the API or service that should accept it
expExpirationUnix timestamp when the token expires; reject tokens past this time
iatIssued atUnix timestamp when the token was created
nbfNot beforeToken must not be accepted before this time
jtiJWT IDUnique identifier — used to prevent replay attacks

JWT vs Session Tokens

JWT (stateless)Session token (stateful)
StorageClient stores the full tokenServer stores session data; client has a session ID
RevocationDifficult — token valid until expiryEasy — delete session from the server
ScalabilityWorks across multiple servers without shared stateRequires shared session store (Redis, DB) for multiple servers
Payload sizeGrows with every claim addedFixed — 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: none attack — ensure your library does not accept tokens with the algorithm set to none.

Frequently Asked Questions