Verystep Guides Verystep Guides

How to Decode a JWT and Check Its Claims (Without Sending It Anywhere)

A mystery 401 usually isn't a server fault at all — the token itself will tell you what's wrong, if you read it in the right order.

Published November 14, 2026 - A Verystep guide

A developer at a laptop debugging a login session, with three connected token segments above the screen

A JWT is three Base64URL parts joined by dots: header, payload, and signature, as set out in RFC 7519. Paste a token from your own app into the decoder, read the header's alg and typ, then work through the payload claims: iss, sub, aud, exp, iat, and nbf. Convert exp from seconds since the epoch and compare it with now, since an expired token is the top cause of mystery 401s. Then check aud and iss against the API you're calling. Remember, decoding isn't verification, and this decoder doesn't check the signature. Treat the token like a password while you work.

Decode it, step by step

Your login works. Then it doesn't. The API throws a 401 and the message tells you almost nothing. Sound familiar? Before you start changing server settings at random, look at the token itself. Nine times out of ten, it's carrying the answer.

  1. Copy a token from your own app, from your browser dev tools or the auth response you just received.
  2. Paste the token into the decoder and wait for the three parts to split out on screen.
  3. Read the header first and note the alg and typ values it shows.
  4. Read the payload claims: iss, sub, aud, exp, iat, and nbf.
  5. Convert exp, nbf, and iat from seconds since the epoch and compare exp with the current time.
  6. Check that aud and iss match the API you are actually calling.
  7. Only after those checks, go and look at your server configuration for the fault.

Work in that order on purpose. Most folks jump straight to server config, change three things, and still can't log in, because the fault was sitting in the token the whole time. Read the token first. It takes two minutes. Then change code.

What you're looking at

A JWT has three parts, joined by dots. Header, payload, signature. Each part is Base64URL encoded, per RFC 7519, so the decoder just turns them back into readable JSON for you. The header says what kind of token it is and which algorithm signed it, in the alg and typ fields.

Three linked rounded segments in a row with a magnifying glass over the middle one
The middle segment is the payload, where the claims you need for debugging live.

Now the part people get wrong. Decoding is not verification. Anyone can decode a JWT, you, me, a stranger who finds one in a log file. The text isn't hidden at all. Only a signature check, done with the right key on a server you trust, proves a token is genuine and untouched. The Verystep decoder runs in your browser and it does not verify the signature. We'll say that plainly: it shows you the contents, nothing more. Don't treat a clean decode as proof that a token is valid.

Check the claims that break logins

Start with exp, the expiry time. It's stored as seconds since the epoch, so convert it and compare it with right now. If exp is in the past, you've found your bug. An expired token is the top cause of mystery 401s, and it often isn't a bug in your code at all. Your session just timed out, your test token was minted yesterday, or your laptop clock is off.

While you're there, check iat and nbf too. iat is when the token was issued. nbf is the time before which it shouldn't be accepted yet. A token used too early fails much like an expired one, and an odd iat can point to a stale token replayed from an old test.

Next, aud and iss. aud names who the token was made for. iss names who issued it. If you're calling API B with a token minted for API A, the claims won't match and the call should fail. That's the system working. You'll see this in local testing, where a staging token gets pasted into a call against production. Check sub as well if your app keys data to a user: a valid, fresh token for the wrong account still looks like a broken login from the user's chair.

Handle the token like a password

Here's the safety bit, and it matters. A decoded token is still a live credential. The payload isn't secret, but the whole string can open doors while it's valid. So don't paste production tokens into random websites you've just found. You don't know where those tokens go. The decoder on this site runs in your browser, which is why this guide sends you there, but make that check a habit with any tool you use: does the token leave your machine, or not?

And don't post tokens in bug tickets, chat threads, or screenshots. People do it daily. Then the screenshot gets forwarded, indexed, or attached to a public issue, and the token outlives the conversation. If you must share what you found, share the claim values that matter, like exp converted to a date, and leave the signature and the full string out. If a real production token has leaked, don't just delete the message. Revoke or rotate it, because copies travel.

Use your own tokens from your own app for this work. A token from someone else's session can expose their account details, and debugging with it can lock them out.

If the claims all look right

So the token's fresh, the audience matches, the issuer matches, and you're still getting rejected. Good. You've ruled out the cheap causes, and now server config is worth your time. Look at which signing key and algorithm your API expects, whether your auth service and your API read the same issuer address, and whether clock skew settings are swallowing borderline tokens. Change one thing at a time, mint a fresh token, decode it again, and compare. That beats a scattershot rewrite of your auth setup every time.

Decode your token in your browser

Open the JWT Decoder, paste in a token from your own app, and read the header and payload claims side by side. It runs in your browser and doesn't verify the signature, so use it to inspect claims like exp, aud, and iss while you debug, not to prove a token is trustworthy.

Open the JWT Decoder ->

Last verified November 14, 2026 — JWT structure and claim names checked against RFC 7519; the decoder's in-browser, no-signature-verification behaviour checked against the Verystep tool page.

Frequently asked questions

Does decoding a JWT prove it's valid?

No. Anyone can decode a JWT, because the header and payload are just Base64URL encoded text. Only a signature check with the right key proves a token is genuine. The Verystep decoder runs in your browser and doesn't verify the signature, so use it to inspect claims, never as proof of trust.

Why does my token decode fine but still get a 401?

Usually the claims. Check exp first: if it's in the past, the token has expired, and that's the most common cause. Then check nbf if the token is being used too early, and make sure aud and iss match the API you're calling. A token minted for one service won't pass on another.

What do exp, iat, and nbf actually mean?

All three are seconds since the epoch. exp is when the token expires, iat is when it was issued, and nbf is the time before which it shouldn't be accepted. Convert them to real dates before you judge them. Raw epoch numbers hide obvious faults, like a token that expired yesterday.

Is it safe to paste a JWT into an online decoder?

It depends where the token goes. A decoded token is still a live credential, so don't paste production tokens into random sites. Use a decoder that runs in your browser, work with your own tokens, and never post a full token in tickets, chats, or screenshots. If one leaks, revoke or rotate it.

The claims look right but login still fails. Now what?

Then look at your server. Check that your API expects the same signing algorithm and key your auth service uses, that both sides read the same issuer address, and that clock skew isn't rejecting borderline tokens. Change one thing at a time, mint a fresh token, and decode it again to compare.

More guides