HomeDeveloper ToolsJWT Decoder
🛡️ JSON Web Token Debugger

JWT Decoder & Token Inspector

Decode JWT headers and claim payloads locally in your browser. Never transmits secrets or sensitive tokens to any server.

Header: Algorithm & Token Type
{
  "alg": "HS256",
  "typ": "JWT"
}
Payload: Claims & Data
{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022,
  "exp": 1878460800
}
Expiration Timestamp (exp):Wed, 11 Jul 2029 10:40:00 GMT

Decoding only reads the token. The signature is not verified, so do not trust these claims until your server has checked the signature.

The three parts of a JSON Web Token

A JWT (RFC 7519) is three Base64URL strings joined by dots: a header, a payload and a signature. The header names the signing algorithm, the payload holds the claims, and the signature is computed over the exact text header.payload. This structure is defined by JSON Web Signature, RFC 7515.

With HS256 the signature is an HMAC-SHA256 using a secret shared between issuer and verifier. With RS256 or ES256 it is an RSA or elliptic-curve signature, so the issuer signs with a private key and anyone with the public key can verify. Either way, the header and payload are only encoded, not encrypted.

Encrypted tokens follow a different standard, JWE (RFC 7516), and have five dot-separated parts. If you paste a five-part JWE here, the decoder shows its protected header, which is only encoded, and explains that the payload cannot be read without the recipient's decryption key.

Decoding the sample token by hand

The token preloaded on this page has the header {"alg":"HS256","typ":"JWT"} and the payload {"sub":"1234567890","name":"John Doe","iat":1516239022,"exp":1878460800}.

The iat claim is a Unix timestamp in seconds: 1516239022 is 18 January 2018 at 01:30:22 UTC. The exp claim, 1878460800, is 11 July 2029 at 10:40:00 UTC, which the decoder shows in readable form. The difference is 362,221,778 seconds, a lifetime of almost eleven and a half years, far longer than any real access token should live.

The decoder converts exp for you but shows iat and nbf as raw numbers. Paste them into a Unix timestamp converter if you need to read them.

Registered claims and what a server must check

RFC 7519 registers a handful of short claim names. A server accepting a token should validate them rather than trusting the payload because it decoded cleanly.

Two historic attacks are worth knowing. Some libraries once accepted tokens with alg set to none, skipping verification entirely. Others let an attacker switch RS256 to HS256 and sign with the public key as if it were an HMAC secret. Pin the expected algorithm in your verification code and both disappear.

  • iss (issuer): must match the identity provider you trust.
  • aud (audience): must include your API, so tokens issued for another service are rejected.
  • exp (expiry) and nbf (not before): compare with the current time, allowing a small clock skew of a minute or so.
  • sub (subject): the user or client the token is about.
  • iat (issued at) and jti (token ID): useful for auditing and for blocking replays.

Handling tokens safely

Treat a live token like a password, because anyone holding it can act as the user until it expires. The decoding on this page happens in your browser with no network request, but the safest habit is still to inspect expired or test tokens rather than production ones.

Since anyone can read the payload, never put secrets, passwords or sensitive personal data in it. Keep access tokens short-lived and pair them with refresh tokens, because a JWT cannot easily be revoked before it expires without extra server-side state.

The header and payload are decoded from Base64URL and then read as UTF-8, so claims containing accented names or other non-ASCII text display correctly. A Bearer prefix copied from an Authorization header is ignored. Decoding never checks the signature, so a token that displays cleanly here may still be forged or expired.

JWT Decoder: frequently asked questions

Is the data inside a JWT encrypted?

Not in a standard signed JWT. The header and payload are Base64URL-encoded, which anyone can reverse. The signature only proves the content has not been changed. If the contents must stay confidential, use JWE or keep the data on the server.

What is the difference between HS256 and RS256?

HS256 uses one shared secret to both sign and verify, so every service that verifies tokens can also create them. RS256 signs with a private key and verifies with a public key, so many services can verify while only the issuer can sign. RS256 suits setups with several independent APIs.

Can I change a claim in the payload and reuse the token?

You can edit and re-encode the payload, but the signature will no longer match. Any server that verifies the signature correctly will reject the modified token. If an edited token is accepted, the server has a serious bug.

What is the kid value in a JWT header?

kid is a key ID. It tells the verifier which key from a key set, often published as a JWKS endpoint, was used to sign the token. This lets an issuer rotate keys without breaking tokens signed with the previous key.

Where should a browser app store a JWT?

An HttpOnly, Secure cookie keeps the token out of reach of JavaScript, which limits damage from cross-site scripting, but then you need CSRF protection. localStorage is simpler but readable by any script on the page. Whichever you choose, short expiry times reduce the impact of a leaked token.

All developer utilities & crypto