JWT Decoder Not Working? Here Is How to Fix It

Published November 28, 2026 · 7 min read · Developer Tools

Last updated: November 28, 2026

JWT Decoder

Decode and inspect any JWT header, payload, and signature instantly in your browser.

Try It Free →

You paste a JWT into a decoder and get back nothing useful: a blank result, an "invalid token" banner, or a payload that looks completely wrong. This is one of the most common friction points developers hit when debugging authentication flows. The good news is that the failure almost always falls into one of five categories, and each one has a clear fix.

Last updated: July 2026

How a JWT Is Structured (the Quick Version)

A JSON Web Token is three Base64url-encoded segments separated by dots: header.payload.signature. The header names the algorithm. The payload carries claims. The signature proves the token was not tampered with. A decoder reads the first two segments without needing the secret. The signature can only be verified if you supply the correct key, but it can always be decoded (the bytes are not encrypted, they are just encoded).

That distinction matters. If your decoder cannot even show the header and payload, the problem is almost certainly structural, not cryptographic.

Problem 1: The Token Is Malformed or Truncated

This is the number-one cause. A JWT copied from a log file, a browser network tab, or a Slack message often gets truncated by a line break or a character limit. Sometimes the padding characters (=) are stripped, or URL-safe characters (- and _) get converted back to standard Base64 characters (+ and /).

How to spot it

  • The token has fewer than two dots, or more than two.
  • The token ends mid-character, suggesting a cut-off.
  • The decoder reports "invalid Base64" or "unexpected end of data".

How to fix it

  1. Copy the token directly from the source: the Authorization header in a network request, the localStorage value via the browser console, or the raw API response body.
  2. Strip any surrounding whitespace, newlines, or quotation marks before pasting.
  3. If you suspect Base64 corruption, paste only the payload segment into the Base64 Encoder Decoder and decode it manually to confirm the JSON is intact.
  4. Do not add = padding. JWT uses Base64url, which omits padding by design. Some older decoders incorrectly require it, but a standards-compliant decoder handles unpadded input.

Problem 2: The Decoder Is Rejecting an Expired Token

Some decoder tools validate the exp claim and refuse to show results if the token is expired. This is technically correct behavior for a verifier, but unhelpful when you just want to inspect the payload for debugging.

How to spot it

  • The decoder shows an "expired token" or "token not yet valid" message instead of the payload.
  • You can confirm by checking the exp field: it is a Unix timestamp. Use the epoch converter to translate it to a human-readable date.

How to fix it

Switch to a decoder that separates decoding from validation. The EveryFreeTool JWT Decoder displays the header and payload regardless of expiry, which is exactly what you need during debugging. If you need a fresh token for integration testing, trigger a new login or token refresh in your application and copy the new value.

Problem 3: "Invalid Signature" When You Do Not Expect It

Many developers paste a JWT into a decoder expecting it to verify the signature automatically. It cannot, because the secret or public key lives on your server. A decoder without the key will always show an unverified signature, and that is correct behavior, not a bug.

If you are running actual signature verification in code and it fails unexpectedly, the most common causes are:

  • Algorithm mismatch. The token header says RS256 but your verification code is configured for HS256. Always read the alg field in the decoded header and match it to your library configuration.
  • Wrong secret encoding. An HMAC secret passed as a plain string vs. a Base64-decoded byte array will produce a completely different signature. Check whether your auth library expects a raw string or a byte buffer.
  • Key rotation lag. Your server rotated to a new signing key but the token was issued with the old one. The kid (key ID) claim in the header tells you which key was used. Confirm your JWKS endpoint still serves that key.

Problem 4: The Payload Decodes but Claims Look Wrong

The decoder works, but the data inside is not what you expected. This is a backend or issuance problem, not a decoder problem.

Common causes

  • Double encoding. The payload was JSON-stringified twice before being signed. The decoded value will be a JSON string rather than a JSON object.
  • Wrong token in storage. Your frontend is reading a stale token from localStorage or a cookie while a newer token exists in memory. Clear storage and re-authenticate.
  • Namespace collision on custom claims. The JWT spec recommends namespacing custom claims (for example, https://yourapp.com/role rather than just role). If two middleware layers add the same key with different values, only one survives.

How to debug it

Paste the raw payload segment into the JSON Formatter after decoding from Base64. That lets you see the exact structure, spot double-encoded strings, and confirm every key-value pair. Cross-reference with what your token issuance code is supposed to put there.

Problem 5: The Decoder Tool Itself Has a Bug or Limitation

Not all JWT decoders are built the same. Some fail silently on tokens signed with newer algorithms like EdDSA. Some strip Unicode characters from the payload. Some have length limits that truncate long tokens containing embedded objects or arrays.

Signs this is the issue

  • The same token decodes correctly in one tool but not another.
  • Non-ASCII characters in claims (names, addresses, internationalized strings) appear as replacement characters.
  • Very long tokens (over 4 KB) produce partial output.

What to do

Test the token in a second decoder. The EveryFreeTool JWT Token Decoder handles standard algorithms and displays the full payload without truncation. If you are working with EdDSA tokens, also verify that the library generating the token is using a supported curve (Ed25519 is standard; Ed448 has limited tooling support as of 2026).

Quick Diagnostic Checklist

  1. Count the dots. A valid JWT has exactly two.
  2. Check for whitespace or line breaks inside the token string.
  3. Confirm the alg claim in the decoded header matches your server config.
  4. Convert the exp timestamp to a date to check expiry.
  5. Isolate whether the issue is decoding (reading bytes) or verification (checking the signature). They are separate operations.
  6. Try a different decoder if the token looks structurally valid but the tool still fails.

Understanding What a Decoder Can and Cannot Do

A JWT decoder reads the header and payload. It does not need a secret to do this. Anyone who has the token string can decode the payload, which is why sensitive data should never be stored in a JWT payload without additional encryption (JWE). Verification, by contrast, confirms the token was signed by the expected party and has not been modified. Only your server can do that, because only your server holds the key.

If your goal is debugging, decoding is enough. If your goal is security enforcement, you need server-side verification, not a browser tool.

Preventing These Problems Upstream

Most JWT decoding headaches are caused at the issuance stage. A few practices eliminate most issues:

  • Always include iat, exp, and kid claims. They make tokens self-documenting and debuggable.
  • Keep payloads small. Put only what the client needs in the token. Store large datasets server-side and reference them by ID.
  • Log the raw token string (at debug level) in your auth middleware during development so you always have a clean copy to test with.
  • Rotate signing keys on a schedule and serve old public keys via your JWKS endpoint for a grace period.

JWT Token Decoder

Paste a raw JWT and see every claim formatted and readable, no backend required.

Try It Free →

Frequently Asked Questions

Why does my JWT decoder show an empty result?

An empty result almost always means the token string is malformed. Check that it contains exactly two dots separating three segments, and that no whitespace or newline characters were included during copy-paste. Try pasting the token again directly from the original source such as a network request header or an API response body.

Can I decode a JWT without the secret key?

Yes. The header and payload segments are Base64url-encoded, not encrypted, so any decoder can read them without the secret. The secret is only required to verify the signature, which confirms the token was not tampered with. This is why you should never store sensitive information in a JWT payload unless you are using JWE (JSON Web Encryption).

Why does the decoder say my token is expired even though it should still be valid?

Some decoders validate the exp claim and refuse to display results if the token has passed its expiry time. This is a limitation of the tool, not a problem with your token. Use a decoder that separates reading from validation, like the EveryFreeTool JWT Decoder, which shows the payload regardless of expiry status.

What does 'invalid signature' mean in a JWT decoder?

It means either the decoder does not have the secret or public key needed to verify the signature, or the token was modified after signing. Browser-based decoders cannot verify signatures without the key, so an 'unverified' status is normal and expected. If verification is failing in your backend code, check for an algorithm mismatch between the token header and your library configuration.

Why does the decoded payload show garbled or unexpected data?

Garbled payload data usually indicates double encoding, where the JSON was stringified twice before being signed. The decoded value will appear as a JSON string inside a string rather than a plain object. You can confirm this by pasting the Base64 payload segment into a Base64 decoder and then checking whether the result is valid JSON or a JSON-escaped string.

Related Tools

🔒 Your data stays in your browser
Need help? Email us