ItsMyIp

JWT token decoder

Paste a token: header, payload and dates decoded instantly, HMAC signature verifiable with your secret — all in your browser, nothing leaves this page.

  • Decoding happens entirely in your browser: neither the token nor the secret is transmitted — to ItsMyIp or anyone. Verifiable in your developer tools' Network tab.

01What is inside a JWT?

A JWT (JSON Web Token) carries signed information between two parties: three base64url-encoded segments separated by dots. The header describes the signing algorithm, the payload holds the “claims” (identity, roles, validity dates), and the signature guarantees the content was not modified. Key point: the content is encoded, not encrypted — anyone can read it, which is precisely what this page does.

This decoder runs entirely in your browser — handy to debug an authentication flow (why this 401?), inspect a token's roles, or check an expiry. The HMAC signature (HS256/384/512) can be verified by pasting the secret, through the WebCrypto API — like our password and DKIM key generators, nothing is transmitted.

02Understanding the standard claims

exp
Expiration date (Unix timestamp). Past this date, the server must reject the token. This decoder's main alert.
iat / nbf
iat: issue date. nbf (not before): the token is invalid before this date — useful for pre-generated tokens.
iss / aud
iss: who issued the token (the auth server's URL). aud: who it is intended for — a server must refuse a token whose audience is not itself.
sub
The subject, usually the authenticated user's identifier.
alg
In the header: the signing algorithm. HS256 = HMAC with a shared secret; RS256/ES256 = asymmetric signature with a key pair; none = unsigned (danger).
kid
In the header: the ID of the key used, so the server can find the right public verification key (rotation).

03Decoding is not trusting

Reading a token proves nothing: only signature verification guarantees it was issued by the right server and not tampered with. Server-side, exp, aud and iss must also be validated — a perfectly signed but expired token, or one meant for another service, must be rejected.

Two classic traps: accepting alg=none (unsigned token) because the library allows it by default, and confusing encoding with encryption — never put a secret (password, API key) in a JWT payload: everyone can read it, as this page demonstrates.

04Frequently asked questions

Is it safe to paste a token here?

Decoding happens entirely in your browser: no network request leaves this page, which you can verify in the developer tools' Network tab. That said, basic caution still applies: a valid production token is a passkey — avoid pasting it anywhere outside your own tools, and prefer test or expired tokens when possible.

Why can't RS256 signatures be verified here?

HS256 signs with a shared secret: anyone who knows the secret can verify, which is what this page does through WebCrypto. RS256, ES256 and friends sign with a private key and verify with the matching public key, usually published by the auth server at a JWKS URL. Fetching it would require a network request — against this page's “nothing leaves” promise.

Can a JWT be revoked?

Not natively: that is its structural weakness. A signed token stays valid until its exp, even if the user is banned in the meantime. The workarounds: short-lived access tokens (5–15 minutes) renewed through a revocable refresh token, or a server-side revocation list — which reintroduces the state JWT claimed to eliminate.

JWT or session cookie: which should I choose?

A database session with an httpOnly cookie remains the simplest and safest choice for a classic web application: instant revocation, no data client-side. JWT shines when several services must verify identity without sharing a session store (microservices, third-party APIs, mobile). The worst of both worlds: storing a long-lived JWT in localStorage, exposed to any XSS.

What is the “alg none” attack?

The JWT specification allows alg=none for unsigned tokens. Some historic libraries accepted a token where the attacker had simply replaced alg with none and stripped the signature — allowing any identity to be forged. Modern libraries require an algorithm allowlist; if this decoder shows alg=none on a token your server accepts, fix it urgently.

05More tools