JWT Decoder Guide: Inspect Claims, Verify Signatures, and Troubleshoot Token Errors
JWTauthenticationAPIsOAuthcybersecurity

JWT Decoder Guide: Inspect Claims, Verify Signatures, and Troubleshoot Token Errors

WWindows.page Editorial Team
2026-12-06
6 min read

Learn how to decode JWTs safely, inspect claims, verify signatures, and troubleshoot expired, malformed, or misconfigured tokens.

A JWT decoder can help you inspect an authentication token, but decoding is not the same as proving that a token is trustworthy. This guide provides a reusable workflow for separating the header, payload, and signature; reading claims; checking timestamps; verifying signatures with the correct key; and troubleshooting common JWT errors without exposing live credentials.

Overview

A JSON Web Token (JWT) is a compact string commonly used to carry claims between an issuer and a client or API. A typical compact JWT has three dot-separated parts:

header.payload.signature

The first two parts are JSON objects encoded with base64url. The third part is a cryptographic signature over the encoded header and payload. For example, a token may look like this:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjMiLCJleHAiOjE3MDAwMDAwMDB9.signature

A browser-based JWT decoder or local coding utility can decode the first two sections so you can inspect their contents. That inspection is useful for debugging API requests, OAuth flows, session issues, and authorization decisions. However, readable claims do not establish that the token was issued by the expected system, has not been altered, or is still valid. Those questions require signature and claim validation.

If you are debugging an API request, also record the request URL, HTTP method, response status, and relevant headers. The HTTP status code debugging guide can help separate authentication failures from unrelated API errors.

Checklist by scenario

When you only need to inspect a token

  1. Copy the token from a safe, controlled debugging context. Prefer a redacted or short-lived test token.
  2. Split the value at the two periods. A compact JWT should produce three segments.
  3. Decode the header and payload as base64url, not ordinary base64 with assumptions about padding.
  4. Format the resulting JSON so nested objects, arrays, and timestamps are easy to read. A JSON formatter can help validate and beautify the decoded output.
  5. Record observations separately from conclusions. For example, “the payload contains an exp claim” is an observation; “the token is valid” is not proven by decoding alone.

When an API returns an authentication error

  1. Confirm that the token is being sent in the expected header format, commonly an Authorization header with a Bearer prefix.
  2. Check for accidental quotation marks, leading or trailing whitespace, line breaks, or a copied prefix that the server does not expect.
  3. Decode the payload and inspect iss, aud, sub, exp, and nbf when present.
  4. Compare the token’s issuer and audience with the API configuration. A token can be correctly signed and still be intended for a different service.
  5. Compare the token’s time claims with the server’s clock and the request time. Small clock differences can matter when a token is close to its boundary.
  6. Check the server logs or identity-provider diagnostics for the precise validation failure, without logging the complete token.

When you must verify the signature

  1. Identify the algorithm in the header, such as an HMAC or public-key algorithm, but treat that value as untrusted input.
  2. Obtain the verification key from a trusted, configured source. Do not accept a secret or public key supplied by the token itself.
  3. Configure the JWT library with an explicit allowlist of algorithms and the expected issuer and audience.
  4. Verify the signature before using claims for access control, identity, or business logic.
  5. Apply application-specific checks after cryptographic verification, including expiration, not-before time, scopes, roles, and required claims.

The exact library calls differ by language and framework. The important sequence is consistent: parse carefully, constrain accepted algorithms, verify with a trusted key, then validate claims and authorization requirements.

JWT claims reference

Claims are name-value pairs in the payload. Registered names are widely recognized, but a token may also contain private claims defined by an application.

ClaimTypical purposeWhat to check
issIdentifies the issuerMatches the configured identity provider or service
subIdentifies the subjectMaps to the expected user, client, or resource
audIdentifies intended recipientsIncludes the API or application validating the token
expExpiration timeHas not passed, allowing for an explicitly defined clock policy
nbfNot-before timeThe token is not being used before its activation time
iatIssued-at timeIs plausible for the event and useful for diagnosing stale tokens
jtiToken identifierCan support replay detection when the application implements it
scope or rolesApplication permissionsAre interpreted according to the API’s authorization rules

Numeric date claims are generally represented as seconds from the Unix epoch. Use a reliable date conversion method and confirm the issuer’s documented format rather than guessing from a single value.

What to double-check

Decoding versus verification

Base64url decoding is reversible encoding, not encryption and not authentication. Anyone who receives a JWT can usually decode its header and payload. Never place passwords, private keys, API secrets, or other sensitive data in claims merely because the payload is difficult to read in its compact form.

Algorithm and key handling

The alg header describes how the token was signed, but it must not dictate an unrestricted verification policy. Configure the expected algorithm in application code. Use the appropriate key type: shared secrets for the algorithms your system intentionally supports, or a trusted public key for asymmetric verification. Do not paste production signing secrets into an online JWT decoder, and do not use a decoded token as proof that its signature is valid.

Token transport and redaction

Access tokens are credentials even when they are expired or limited in scope. Redact them in screenshots, tickets, chat messages, browser recordings, and logs. If a live token is accidentally disclosed, follow your organization’s rotation or revocation procedure. For local troubleshooting, replace the signature and sensitive identifiers with test values when possible.

JWT issues can also be caused by an incorrectly encoded URL, query parameter, or request body. If the token is being passed through a URL, review the URL encoding guide; avoid putting bearer credentials in URLs unless the protocol and security design explicitly require it.

Common mistakes

  • Assuming three segments guarantee a valid JWT: Structure helps identify a compact token, but it does not validate the JSON, signature, issuer, or permissions.
  • Confusing an expired token with a malformed token: An expired token may decode perfectly. Inspect parsing errors, time claims, and server validation messages separately.
  • Ignoring audience and issuer: A valid token from one environment or service may be rejected by another because it was not intended for that recipient.
  • Trusting client-side claims: A frontend may display decoded roles or names, but an API must perform its own verification and authorization checks.
  • Logging the Authorization header: Request logging and debugging middleware should redact bearer tokens by default.
  • Using an online decoder with sensitive data: Browser tools are convenient for synthetic or redacted tokens. Use a local decoder for confidential or production material and review the tool’s handling model before submitting any token.
  • Blaming JWT for every 401 or 403: Check routing, scopes, API configuration, clock synchronization, proxy behavior, and the request’s other headers. The failure may occur outside token parsing.

When to revisit

Revisit this checklist whenever an identity provider, API gateway, JWT library, signing algorithm, key-rotation process, or environment configuration changes. It is especially useful before deploying a new authentication integration, after rotating keys, when moving between staging and production, or when an API begins rejecting previously accepted requests.

For a repeatable review, save a redacted diagnostic record containing the token shape, decoded non-sensitive claims, expected issuer and audience, configured algorithm, key source, request timestamp, and server response. Do not save the complete credential. Then work through these final actions:

  1. Decode only in a controlled environment and confirm the token has the expected three-part structure.
  2. Check required claims and compare issuer, audience, and time values with the receiving service’s configuration.
  3. Verify the signature with a trusted key and an explicit algorithm allowlist.
  4. Validate scopes, roles, and application-specific permissions after signature verification.
  5. Redact or rotate any token that was exposed during debugging.
  6. Document the confirmed cause and the test token or fixture used, so the next investigation starts with reproducible evidence.

Used this way, a JWT decoder is a practical inspection tool within a broader authentication-debugging workflow—not a substitute for cryptographic verification or authorization checks.

Related Topics

#JWT#authentication#APIs#OAuth#cybersecurity
W

Windows.page Editorial Team

Developer Tools Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.