JWT Decoder

Paste a JSON Web Token and read its header and payload as formatted JSON — with expiry times translated to human dates. Fully offline.

1,174 views

How It Works

A JSON Web Token is a compact string built from three Base64URL-encoded parts joined by dots: header.payload.signature. Base64URL is a URL-safe variant of Base64 that swaps +// for -/_ and drops the trailing = padding, so the result can sit inside a URL or an HTTP header without escaping. The header is a small JSON object naming the signing algorithm and token type — typically {"alg":"HS256","typ":"JWT"}. The payload is a JSON object of "claims": arbitrary key/value pairs describing who the token represents and what it is allowed to do, plus a few registered time claims — iat (issued at), nbf (not valid before) and exp (expiration), all stored as Unix timestamps. The signature is computed over the first two parts using the algorithm named in the header and a key only the issuing server holds.

Paste a token here and the tool splits it on its two dots, Base64URL-decodes the header and payload, and pretty-prints each as indented JSON. Any exp/iat/nbf values are additionally converted to a human-readable date, with a badge showing at a glance whether the token is currently expired.

JWTs are the backbone of most modern authentication: OAuth 2.0 access tokens, OpenID Connect ID tokens, and custom session systems all use this format because it lets a server issue a self-contained credential that other services can read without a database lookup — as long as they can verify the signature. Common algorithms are HS256 (a shared-secret HMAC) and RS256/ES256 (asymmetric RSA or elliptic-curve signatures, where the issuer keeps a private key and anyone can verify with the matching public key).

What You Should Know

Decoding is not verifying. The header and payload are only encoded, not encrypted, so anyone can read them without a key — and anyone can also forge a token with whatever claims they like. What makes a JWT trustworthy is exclusively its signature, and checking a signature needs the secret (HMAC algorithms) or the public key of the issuer (RSA/ECDSA algorithms). That check belongs on a server that holds the key; it cannot be done safely inside a browser tool, since exposing a secret there would defeat its purpose. Treat this decoder strictly as a debugging aid — never as proof a token is genuine or still valid.

Also handle what you paste carefully: a JWT carries session or authorization data, so treat it like a password and avoid pasting live production tokens into any tool on a shared machine. Tokens with five dot-separated parts are JWE (encrypted), not JWS (signed) — this decoder handles the far more common signed variant. And never trust the alg field blindly in your own verification code — a well-known attack tricks naive implementations into accepting alg: none or swapping RS256 for HS256, which is why signature verification belongs in vetted libraries rather than hand-rolled code.

Frequently Asked Questions

Does decoding verify that the token is valid?

No — decoding only reads the contents. Signature verification requires the signing secret or public key and belongs on your server. Anyone can craft a token with any payload; only the signature proves authenticity.

Is it safe to paste a real production token here?

The tool never transmits the token — decoding is local. Still, treat production tokens like passwords: prefer expired or test tokens when debugging in shared environments.

Why does my token fail to decode?

Check that you copied all three dot-separated parts and no line breaks were introduced. Encrypted tokens (JWE, five parts) cannot be read without the key — this tool handles signed JWS tokens, the common kind.

What is the difference between a JWS and a JWE token?

JWS (JSON Web Signature) is the signed format this tool decodes — three parts, readable but tamper-evident. JWE (JSON Web Encryption) has five parts and the payload itself is encrypted, so it cannot be read at all without the decryption key; if your token does not decode here and has four dots instead of two, it is most likely a JWE.

What do the exp, iat and nbf claims mean?

All three are Unix timestamps (seconds since 1970-01-01). iat records when the token was issued, nbf marks the earliest moment it becomes valid, and exp marks the moment it stops being valid. A correctly behaving server rejects any token where the current time falls outside the nbf-exp window.

Comments

No comments yet — be the first to write one!

Similar Tools