How to handle JWT expiration and token refresh
Why JWTs expire, what the exp claim really is, and how the access-token + refresh-token pattern keeps users logged in without long-lived credentials.
Decode and inspect a JWT's header, payload and claims online. Runs 100% in your browser - your tokens are never uploaded or sent to any server.
Paste any JSON Web Token to instantly decode the header and payload, view standard claims (iss, sub, exp, iat) in human-readable form, and check expiry status. Decoding runs entirely in your browser - your tokens never leave your device.
Copy your JWT (the long string with two dots) into the input.
Header and payload are decoded automatically as you paste.
Standard claims like exp and iat are highlighted with their meaning.
Both segments are Base64URL-decoded and pretty-printed as JSON.
Timestamps (iat, exp, nbf) are converted to readable dates and validity status.
See immediately whether a token is currently valid, expired or not yet active.
Decoding happens in your browser - tokens are not transmitted anywhere.
A JSON Web Token (JWT) is three Base64URL-encoded strings joined by dots: header.payload.signature. The first two segments are plain JSON that anyone can read once decoded - only the signature requires a secret to produce or verify.
alg, e.g. HS256 or RS256) and type (typ: "JWT").Because the header and payload are only encoded - not encrypted - never put passwords or secrets inside a JWT. Anyone who intercepts it can read every claim, exactly as this decoder does.
The JWT spec (RFC 7519) reserves seven registered claims. Your backend usually adds custom claims (like role or email) alongside them.
| Claim | Name | Meaning |
|---|---|---|
iss | Issuer | Who created and signed the token. |
sub | Subject | Who the token is about - usually the user ID. |
aud | Audience | The recipient the token is intended for. |
exp | Expiration | When the token stops being valid, as a Unix timestamp. |
nbf | Not before | The token is invalid until this time. |
iat | Issued at | When the token was created. |
jti | JWT ID | A unique identifier, used to prevent replay. |
The decoder above converts exp, iat and nbf from Unix seconds into readable UTC dates automatically and tells you whether the token is currently valid.
These are two different operations, and mixing them up is the most common JWT mistake.
So this decoder is a debugging and inspection tool: use it to see why a token was rejected, check an exp time, or confirm which claims your auth provider sends. Never treat a decoded payload as trusted input in your application.
A JWT is often a live credential - an access or session token that grants whoever holds it. Pasting one into a typical online decoder sends that credential to a stranger's server, where it can be logged, cached, or replayed until it expires.
Filesty decodes entirely in your browser with JavaScript. The token is split and Base64URL-decoded locally; no network request is made and nothing is stored. You can verify this yourself: open your browser's DevTools -> Network tab, paste a token, and watch - not a single request fires.
For a token that is still valid, that difference matters. Decode it here, or in your own terminal, rather than handing an active credential to a third party.
header.payload.signature (or header.payload for an unsigned token). Check for a missing dot or copied whitespace.Bearer prefix was pasted along with it.exp claim is in the past. The token decoded fine; it's simply no longer accepted, and your app needs to refresh it.