JWT Decoder — Decode & Inspect Tokens Online

JWT Decoder

Paste a JSON Web Token and the decoder splits it into its header, payload and signature, shows the first two as formatted JSON, and checks the signature when you supply a key. Give it an HMAC secret or an RSA, ECDSA or EdDSA public key and it verifies the signature in your browser. The token is not sent anywhere: the JWT code makes no network request with it, and the analytics events it emits carry only the algorithm, a verified flag and an error code.

How this tool handles a token

  • Input cleanup. The text is trimmed, a leading Bearer (any case) is removed, and all whitespace is removed, so a token wrapped across lines still works.
  • Structure. The token must have exactly three parts separated by dots. Otherwise the error reads expected 3 parts separated by dots, found N.
  • Header and payload. Each part is decoded as base64url, then as strict UTF-8, then parsed as JSON. It must be a JSON object. The error names the part that failed.
  • Signature. Only checked for base64url characters at decode time. It is not verified until you supply a key.
  • Algorithm. Read from the token's own alg header, never from the page. The verifier accepts only that one algorithm. All 13 algorithms the encoder supports are accepted: HS256/384/512, RS256/384/512, PS256/384/512, ES256/384/512 and EdDSA.
  • Keys. For HS algorithms the secret is used as UTF-8 bytes, or as base64 bytes when the Base64 option is on. For the other algorithms the key must be a PEM -----BEGIN PUBLIC KEY----- block (SPKI). Any other PEM type, such as a private key, gives an invalid_key error and the result stays unverified.
  • Result. Verified (signature matches), Invalid signature (does not match) or Not verified (no key given). A token with alg: none is reported as an unsigned token. A missing or unsupported alg is an error.
  • Claims. exp, nbf and iat are read against the clock and labelled valid, expired, not yet valid or no expiry. They never change the verified result. iss and aud are not checked. The kid header is not used to look up a key, so you paste the key yourself.

Worked example

The token below is the output of the JWT Encoder with its default HS256 header, payload and test secret. The decoder output was produced by running the tool's own inspectToken function on it. The token field and the error field are omitted when empty.

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.fZb1-TC_2CI6k3303yzOYDiDBB9kZeoKgVqBHyCURAI

With the secret test_secret12312312312312312312312 the result is:

{
  "alg": "HS256",
  "header": { "alg": "HS256", "typ": "JWT" },
  "payload": { "sub": "1234567890", "name": "John Doe", "iat": 1516239022 },
  "verified": true,
  "timeStatus": { "state": "no-exp", "messages": ["No exp claim: token never expires"] }
}

With no key, verified is null. With the wrong secret it is false and the error is Invalid signature with the hint "Check the shared secret".

Gotchas

1. verified: true does not mean the token is still valid. A token whose exp is in the past still verifies. This token has exp 1735689600 (2025-01-01) and was checked against 2026-01-01:

{ "verified": true, "timeStatus": { "state": "expired", "messages": ["Expired last year"] } }

Read timeStatus as well as verified.

2. A base64 secret is used as text unless you say so. The secret bXktaG1hYy1rZXktYnl0ZXMtMDEyMzQ1Njc4OWFi signed a token. Without the Base64 option the verifier uses the 40 characters as bytes and returns verified: false. With the option on it returns verified: true.

3. An RS256 token needs the public key, not a secret. Pasting the HMAC secret for an RS256 token gives verified: null and an invalid_key error: Invalid public key format for RS256. Expected 'PUBLIC KEY' (SPKI).

4. alg: none is flagged, not accepted. A token built from {"alg":"none","typ":"JWT"} and {"sub":"1"} with an empty signature returns verified: false and the code unsigned_token.

5. The payload is readable without the key. The payload segment of the token above is only base64url:

echo eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ | base64 -d
# {"sub":"1234567890","name":"John Doe","iat":1516239022}

Do not put passwords or private data in a payload, whatever the signature says.

FAQ

Is my token uploaded?

No. Decoding and verification run in the browser, and the token is not included in any request. Analytics events carry the algorithm, a verified flag and an error code only.

Which keys does the verifier accept?

For HS256, HS384 and HS512, the shared secret, as text or as base64. For RS, PS, ES and EdDSA tokens, a PEM public key in SPKI format (-----BEGIN PUBLIC KEY-----). A private key or a PKCS#1 key is rejected with a message that says so.

Does the decoder check exp, iss and aud?

It reads exp, nbf and iat and labels them. It does not check iss or aud, and a token that has expired still verifies. Compare those claims against what your service expects.

What does "Not verified" mean?

No key was entered, so the signature was not checked. The header and payload are still decoded.

Can it decode encrypted tokens (JWE)?

No. The decoder expects three parts. A JWE token has five parts and returns the "expected 3 parts" error.