Decoding needs no key; verification does
All three segments are Base64URL, so anyone holding a token can read the header and payload — algorithm, subject, roles, expiry. That is why payloads never hold secrets. Only the signature demands a key: recompute with the same secret under the header's algorithm and compare. This tool decodes by default, and verifies only when a key is supplied.
Steps
- Paste the full token, three dot-separated segments.
- Parse to see header, payload, signature and expiry state.
- Supply a key to recompute and flag whether the signature matches.
- Load the sample or clear.
- Copy the result or download it as JSON.
Which claims decide expiry
exp is the expiry in seconds since the epoch; nbf is the earliest valid moment; iat records issuance. All three render as readable times alongside the current clock. Allow small skew, since server and client drift by seconds. A token without exp never expires, which is dangerous design: leaked long-lived credentials cannot lapse naturally.
What a failed signature means
Wrong key, wrong algorithm, a modified token, or a truncated copy all fail. Editing either the header or the payload breaks the signature. Tokens with algorithm none carry no signature and can be forged by anyone, so servers must reject them outright. Algorithm confusion matters too: a server trusting the header can be tricked into verifying an asymmetric token with the public key as a shared secret — the classic historical exploit.
Common problems
Treating decoded output as trustworthy. Authorising from payload without verifying, which trusts whatever the client sent. Losing characters when copying a long token, so length deserves a check. Feeding Base64URL to a Base64 decoder, which fails on plus and slash. Reading exp as milliseconds and concluding expiry is millennia away. And verifying only the signature while skipping issuer and audience checks, which lets a token be replayed against another service.
A practical diagnostic order:Decode first and read the claims: is the subject right, are roles present, has exp passed. Then verify the signature. Then confirm the algorithm appears in the server allow-list. Finally check clock and zone for expiry drift. In production troubleshooting, never log full tokens — a token is a short-lived credential and exposure demands immediate key rotation.