Inspector tool

JWT Decoder and Inspector

Paste a JSON Web Token to read its header and claims, see when it expires in UTC and your own time, and check an HS256 signature with the secret.

Do not paste production secrets or live access tokens into a shared machine. Decoding stays in this browser tab and is cleared when you leave the page.

0 characters. Decoding happens as you type; the token stays in this tab and is gone when you close it or press Clear.

Preview

Decoded token

Paste a JWT to see its header, claims and expiry.

JWT Decoder and Inspector

Operator: Abdulla Al Fahad. How tools are built and checked

An API answers 401 and the only clue is a long string starting with eyJ in the Authorization header. That string is a JSON Web Token, and most of what you need to know about it is written inside in plain JSON, just base64url-encoded: who issued it, who it is for, when it was issued and when it stops working. Paste it here and the header and payload are spelled out, the time claims are turned into dates you can read, and a banner says whether the token has expired, is not valid yet, or has no expiry at all.

Decoding is not the same as trusting. Anyone can write a token with any claims; what makes it genuine is the signature in the third part. For tokens signed with HS256, type the shared secret and the HMAC is recomputed and compared with the signature. For RS256, ES256 and other public-key algorithms the signature is plainly marked as not checked, because this version does not load public keys.

Key features

  • Header and payload shown as indented JSON, each with its own copy button
  • Algorithm (alg) and token type (typ) pulled out of the header
  • Claims table with the registered claims iss, sub, aud, exp, nbf, iat and jti first, then every custom claim
  • exp, nbf and iat shown in UTC and in your local time
  • Status banner: expired, not valid yet, within its time window, or no expiry claim
  • Warnings for alg none, a missing alg, an empty signature, a payload that is not an object, and an exp that looks like milliseconds
  • HS256 signature check with a hidden secret field and a show toggle
  • Errors that name the broken part: header, payload or signature

Token structure, pasting rules and time claims

A signed JWT (strictly, a JWS in compact form) is three base64url strings joined by two dots: header.payload.signature. The header and payload are UTF-8 JSON; the signature is raw bytes. Base64url uses - and _ in place of + and /, and drops the = padding, which is why a token pasted through a tool that expects ordinary base64 often fails to decode.

The decoder accepts up to 64 KB of text. Spaces and line breaks around the token are trimmed, and a leading "Bearer " copied from a header is ignored, but whitespace inside the token is refused because it means the token was wrapped or split. A token with five parts is an encrypted JWE; its payload cannot be read without the decryption key, which is reported instead of attempted.

The registered time claims exp, nbf and iat are NumericDate values: seconds since 1 January 1970 UTC, not milliseconds. Each is shown as the raw number, as a UTC date, and as a date in the time zone your browser reports.

How it works

The text is trimmed, a Bearer prefix is removed, and the rest is split on dots. Anything other than three parts stops with a message giving the count. The header and payload are each converted from base64url to bytes, decoded with TextDecoder in strict UTF-8 mode, and parsed with JSON.parse. If one of those steps fails, the error says which part failed and at which step, so a truncated payload is not reported as a broken header.

Claims are read from the parsed payload. The status compares exp and nbf with the current time from your device clock, which the page refreshes every 15 seconds while it is open. A token is expired once the current second reaches exp, and not valid yet while the current second is before nbf. Libraries often allow a few seconds of clock skew; this page does not, so a token that expired moments ago shows as expired here even if a lenient server still accepts it.

For HS256, the secret you type is encoded as UTF-8 and imported into the browser's Web Crypto API as an HMAC-SHA256 key. The page signs the exact header.payload text from your token, then compares the result with the decoded signature byte by byte, in a loop that always runs to the end so the comparison takes the same time wherever the bytes differ.

The token and secret are kept only in the page's memory and are not put in the address bar. This tool writes nothing to localStorage, sessionStorage or IndexedDB, and the token is decoded in this tab. Closing the tab or pressing Clear removes them. The copy buttons put the header or payload JSON on your clipboard only when you press them.

When this helps

  • Finding out whether a 401 from an API is caused by an expired access token
  • Checking that a login service puts the right audience and issuer into the tokens it hands out
  • Comparing the claims in a staging token with a production token to spot a missing role or scope
  • Confirming that the HS256 secret in a configuration file is the one that signed a test token
  • Reading the user ID or tenant ID from a token captured in a support ticket's request log

Opening a file

  1. Copy the token from the Authorization header, a cookie or a log line, and paste it into the Encoded token box; a .txt file that holds only the token can be opened instead.
  2. Read the status banner first: it answers the most common question, whether the token has run out.
  3. Check the claims table for the issuer (iss), audience (aud) and subject (sub) your server expects.
  4. If alg is HS256 and you have the secret, type it in the Signature panel and press Check signature.
  5. Press Clear token and secret when you are done, especially on a shared computer.

Example

Pasted token (HS256, payload shortened here)

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

What the page shows

Status: No exp claim (the token never expires on its own)
alg: HS256    typ: JWT

sub   Subject       "1234567890"
iat   Issued at     1516239022  UTC: Thu, 18 Jan 2018 01:30:22 GMT
name  Custom claim  "John Doe"

Secret your-256-bit-secret -> Signature matches
Secret anything-else      -> Signature does not match

Tips for best results

  • If the status says expired but your server accepted the token, compare clocks: the issuing server's clock or yours may be off.
  • An exp around 1.7 trillion rather than 1.7 billion was written in milliseconds; it is warned about because most libraries will read it as a date far in the future.
  • aud can be a string or an array; the claims table shows whichever form the token uses, which matters when a library expects one form.
  • When an HS256 check fails with a secret you are sure of, ask whether the issuer base64-decodes the secret before using it. This page uses the secret's text exactly as typed.
  • Paste tokens from a test account where you can. A production access token is a password for as long as it lives.

Limits

A decoded token proves nothing about who made it. The claims are readable by anyone and can be edited by anyone; only a signature check against the right key shows that the issuer produced them.

alg set to none means the token is unsigned. A server that accepts such tokens lets anyone log in as anyone, which is why it is flagged.

The status uses your device clock. If that clock is wrong, the expired and not valid yet verdicts are wrong by the same amount.

RS256, ES256, PS256 and EdDSA tokens are decoded but not verified. A matching signature for those needs the issuer's public key, usually from its JWKS endpoint, which this version does not fetch or accept.

Encrypted tokens (JWE, five parts) cannot be read here at all.

Common errors and how to fix them

"A signed JWT has exactly three parts separated by two dots; this text has 2 parts."
Part of the token was not copied, often the signature after the last dot. Copy the whole value again, from the first character after "Bearer " to the end of the line.
"Payload is not valid base64url."
A character outside A to Z, a to z, 0 to 9, - and _ is inside the payload. Quotes, a trailing comma from a JSON log, or a URL-encoded %3D are the usual culprits; remove them and paste again.
"Header decodes to text that is not valid JSON."
The first part is base64url but not JSON, which happens when two tokens were pasted together or the text is not a JWT at all, such as an opaque session ID.
Signature does not match even with the right secret.
Check for a trailing space or newline copied with the secret, and check whether the issuer treats the secret as base64. If the token was edited by hand, any change to the header or payload breaks the signature.

Best practices

  • Treat a live token like a password: paste it, read what you need, then clear it.
  • Rotate any secret you suspect was exposed while debugging, whichever tool you checked it with.
  • Keep access tokens short-lived and put an exp in every token your service issues.
  • Verify tokens in your server code with a maintained library that pins the expected algorithm; use this page to understand a token, not to accept one.

What each registered claim means

RFC 7519 defines seven claim names that libraries understand. None is mandatory, but servers usually check some of them before accepting a token.

  • iss (issuer): who created and signed the token, often a URL such as your identity provider's address
  • sub (subject): who the token is about, usually a user ID
  • aud (audience): which service the token is meant for; a server should refuse tokens addressed to someone else
  • exp (expiration time): the second after which the token must be refused
  • nbf (not before): the second before which the token must be refused
  • iat (issued at): when the token was created, useful for spotting tokens older than you expect
  • jti (JWT ID): a unique ID that lets a server refuse a token it has already seen

Why HS256 can be checked here and RS256 cannot

HS256 is symmetric: the same secret signs and verifies, so if you hold the secret, recomputing the HMAC over the first two parts settles the question. RS256 and ES256 sign with a private key and verify with a public key published by the issuer. Checking those means importing that public key in the right format, and this version keeps to tokens and secrets typed into the page rather than loading keys.

Frequently asked questions

Does this page send my token anywhere?

No. Decoding and the HS256 check run in the page's own JavaScript with the browser's TextDecoder and Web Crypto. There is no upload, the token is not saved to storage, and it is not added to the page address.

Can it tell me whether a token is genuine?

Only for HS256, and only if you have the secret. For every other algorithm it shows the contents but makes no claim about the signature.

Why does the page say expired when my app still works?

Your app may be refreshing the token in the background, or its server may allow some clock skew. The page compares exp with your clock to the second.

Can I edit claims and re-sign the token?

No. The page reads and checks tokens; it does not create or modify them.