ToolsWaves
Dev ToolsApril 16, 2026ยท7 min read

How to Decode and Read JWT Tokens (JSON Web Token Guide)

JWTs are everywhere in modern auth โ€” but decoding one shouldn't require pasting it into a sketchy website. Learn how JWTs work and decode them safely in your browser.

Authentication and security tokens visualization
๐ŸŽซ

Try the tool right now

JWT Decoder

Open Tool โ†’

What is a JWT?

A JSON Web Token (JWT, often pronounced 'jot') is a compact, URL-safe way to represent claims between two parties. JWTs are the backbone of modern authentication โ€” every time you log into a web app, the server typically issues a JWT that proves your identity for subsequent requests.

A JWT is just a string with three parts separated by dots: xxxxx.yyyyy.zzzzz. Each part is Base64URL-encoded JSON or binary data. The structure is intentionally simple so that JWTs work everywhere: HTTP headers, cookies, URL parameters, and mobile apps.

Anatomy of a JWT: Header, Payload, Signature

1. Header

Specifies the signing algorithm (alg) and token type (typ, usually JWT). Example: {"alg":"HS256","typ":"JWT"}. This is Base64URL-encoded into the first segment.

2. Payload

Contains the claims โ€” the actual data being transmitted. Common claims include sub (subject/user ID), iat (issued at), exp (expiration), and any custom data your app needs. Base64URL-encoded into the second segment.

3. Signature

A cryptographic signature created by encoding the header and payload, then signing them with a secret key (or private key for asymmetric algorithms). This proves the token was not tampered with. The signature is the third segment.

When to Decode JWTs

Developers decode JWTs constantly. Common scenarios include:

  • Debugging authentication โ€” Why is my API returning 401?
  • Inspecting expiration โ€” When does this token expire?
  • Checking user claims โ€” What permissions does this token have?
  • Verifying token format โ€” Is the issuer correct?
  • API testing โ€” What data is the server sending in the token?
  • Learning โ€” Understanding what backend libraries actually generate

How to Use Our JWT Decoder Safely

Most online JWT decoders send your token to their server. That is a problem if your token is for production, since anyone with the token can impersonate the user. Our JWT decoder runs entirely in your browser:

  • Paste the JWT into the input box
  • Click 'Decode' to instantly see the header, payload, and signature
  • Timestamp claims (iat, exp, nbf) are automatically converted to readable dates
  • Expired tokens are flagged in red

The token never leaves your browser, so even production tokens with sensitive claims are safe to inspect.

Standard JWT Claims Explained

  • iss โ€” Issuer. Who created the token (often a URL like https://auth.example.com).
  • sub โ€” Subject. Who the token is about (typically a user ID).
  • aud โ€” Audience. Who the token is intended for (your API).
  • exp โ€” Expiration time (Unix timestamp). Token is invalid after this.
  • nbf โ€” Not Before. Token is invalid before this timestamp.
  • iat โ€” Issued At. When the token was created.
  • jti โ€” JWT ID. Unique identifier for the token (used for revocation).

JWT Security: What Decoding Does and Does Not Prove

Decoding a JWT shows you what is inside. It does NOT verify that the token is valid. Anyone can craft a JWT with any payload โ€” only the signature, when verified with the secret key, proves authenticity.

This is why client-side JavaScript should never trust JWT contents for authorization decisions. Always verify the signature on the server using the secret/public key. Decoding is for inspection and debugging only.

Common JWT Best Practices

  • Use HTTPS exclusively โ€” JWTs in plaintext can be stolen by anyone on the network
  • Set short expirations โ€” 15-60 minutes for access tokens, longer for refresh tokens
  • Use HS256 with strong secrets, or RS256/ES256 for asymmetric verification
  • Never store JWTs in localStorage if XSS is a concern; use httpOnly cookies
  • Keep payloads small โ€” JWTs are sent on every request and bloat headers
  • Implement token revocation via short expirations and a revocation list (jti)

Final Thoughts

JWTs are deceptively simple โ€” three Base64-encoded segments separated by dots โ€” but they power authentication for the modern web. Whether you are debugging a 401 error, inspecting a token's claims, or just learning how auth works, having a fast and private JWT decoder in your toolkit is essential. Our tool decodes JWTs instantly in your browser, validates the structure, and highlights expiration dates so you can debug auth issues in seconds without leaking sensitive tokens to a third party.

Try JWT Decoder Now

Frequently Asked Questions

Is it safe to decode production JWTs with this tool?

Yes. Our JWT decoder runs entirely in your browser using JavaScript. The token is never sent to any server, logged, or stored. Even production tokens with sensitive claims are safe to inspect.

Does the tool verify the JWT signature?

No. Signature verification requires the secret key (HS256) or public key (RS256/ES256) used to sign the token. Sharing those keys with a browser tool would defeat their purpose. Use this for inspection, not verification.

Why is the signature shown but not decoded?

The signature is a cryptographic hash, not encoded JSON. Unlike the header and payload, it cannot be 'decoded' to reveal meaningful contents โ€” you can only verify it matches the expected signature using the original signing key.

What if my JWT has invalid format?

JWTs must have exactly three segments separated by dots. If you see an error, check that the token is complete and not truncated, and that you are not pasting an OAuth token (which is not necessarily a JWT).

Can the tool decode encrypted JWTs (JWE)?

No. This tool decodes signed JWTs (JWS) where contents are visible after Base64 decoding. JWE tokens are encrypted and require the decryption key to read. Most APIs use signed (not encrypted) JWTs.

Related Articles