Codepackr / encoders / JWT Inspector & Validator

JWT Inspector & Validator

Inspect, decode, and validate JSON Web Token (JWT) headers, payloads, signatures, and expiration status in browser memory.

Client-Side Execution & Privacy Guarantee

This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.

A JSON Web Token arrives as a single string of three Base64url segments. The JWT Inspector splits that string, decodes the header and payload into readable JSON, and optionally verifies an HS256 signature when you supply the secret. It also interprets registered time claims so you can see at a glance whether the token is expired or not yet valid.

All work occurs locally. The token never leaves the browser, which matters when you are examining production tokens that contain user identifiers or roles. The inspector is deliberately limited to HS256 signature checks so that it pairs cleanly with the companion encoder; other algorithms are decoded but not verified.

Decoding the segments

The tool splits on the period character and Base64url-decodes the first two segments. Invalid Base64url or malformed JSON produces a clear error instead of partial output. The signature segment is displayed as-is until verification is requested.

Because the payload is only encoded, not encrypted, the inspector always shows its contents. Use this visibility to confirm that an API is emitting the claims you expect before you invest time in signature or expiration debugging.

HS256 signature validation

When you provide the secret, the inspector recomputes the HMAC-SHA256 over the header.payload string and compares it (constant-time) with the signature segment. A match means the token was produced by someone who knows the secret; a mismatch means the token was altered or the wrong secret was used.

Verification is skipped if the header algorithm is not HS256 or if no secret is supplied. In those cases the tool still shows the decoded claims so you can inspect the token even when you cannot validate it.

Time claims and expiration status

The inspector reads exp, nbf, and iat when they are present and numeric. It converts each NumericDate to a local date-time string and compares exp against the current clock. An expired token is clearly labeled; a token whose nbf is still in the future is labeled not-yet-valid.

Clock skew is not adjusted. If your environment has a few seconds of drift you may see a token flagged as expired a moment early; that is expected and matches strict library behavior.

When to use this tool

  • Confirming that a token received from an API contains the expected claims
  • Checking whether a token has expired before blaming an authorization failure
  • Verifying that an HS256 token matches a known secret during local debugging
  • Teaching the difference between decoding and validation
  • Comparing the output of the encoder against a token produced by another library

How to use the JWT Inspector & Validator

  1. Paste the complete JWT into the token field.
  2. Optionally enter the HS256 secret if you want signature validation.
  3. Click Inspect. Header, payload, and status appear immediately.
  4. Review the expiration label and the converted timestamps.
  5. If the signature fails, double-check the secret and that the header alg is HS256.
  6. Copy any individual claim or the whole decoded payload as needed.
  7. Clear the token field when you are finished.

Worked examples

Valid unexpired token

Input
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\nSecret: your-256-bit-secret
Output
Header: {"alg":"HS256","typ":"JWT"}\nPayload: {"sub":"1234567890","name":"John Doe","iat":1516239022}\nSignature: valid\nIssued: 2018-01-18 (approx)

Signature matches. iat is in the past; no exp is present so the token is not considered expired by this tool.

Expired token detection

Input
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjb2RlcGFja3IiLCJzdWIiOiJ1c2VyNDIiLCJleHAiOjE3MzU2ODk2MDB9.W7Y6NORhaM5hQA6Db_zEDXxN_MSun2LlsR2zkSkVl-s\nSecret: dev-secret
Output
Header: {"alg":"HS256","typ":"JWT"}\nPayload: {"iss":"codepackr","sub":"user42","exp":1735689600}\nSignature: valid\nStatus: expired (exp was 2025-01-01)

Signature is correct but the exp claim is in the past, so the inspector marks the token expired.

Common mistakes and tips

  • Always verify the signature before trusting claims; decoding alone proves nothing about authenticity.
  • If verification fails, first confirm the secret is identical, including trailing whitespace.
  • Tokens without an exp claim never expire according to this tool; that matches the JWT specification.
  • Copy the token carefully; a missing character at the end will make the signature invalid.
  • Use the timestamp tool to convert NumericDate values when you need exact UTC times.

Frequently asked questions

Can the inspector validate RS256 or ES256 tokens?

No. It only recomputes HS256 signatures. Other algorithms are decoded so you can read the claims, but the signature is left unchecked.

What if the token has more than three segments?

The tool expects exactly three segments. Extra periods cause a parse error.

Does it handle encrypted JWTs (JWE)?

No. JWE tokens have five segments and are encrypted. The inspector only processes plain JWTs.

Why does a token I just created show as expired?

Check the exp claim. If you set it to a past timestamp the inspector will correctly report expiration.

Is the secret stored after I enter it?

No. The secret is used only for the current verification and is discarded when you clear the form or leave the page.