JWT Decoder
Decode and inspect JWT header, payload and expiry — entirely in your browser.
Paste a JSON Web Token and read its header, payload and expiry instantly — decoded locally, never uploaded. Free. No sign-up. Runs in your browser, nothing is uploaded.
Paste a token and you see three things at once: the header with its signing algorithm, the payload with all claims as pretty-printed JSON, and the time claims exp, iat and nbf converted to UTC dates with a relative time such as "in 58 minutes" or "3 days ago". A badge shows Expired or Not expired based on exp. You can paste the raw token, a full Authorization: Bearer … header or a line copied out of a log — the clutter is stripped before decoding.
Reading a token: what the three parts hold
A JWT is three base64url strings joined by dots: header.payload.signature.
- Header — usually
{"alg": "HS256", "typ": "JWT"}.algnames how the signature was made:HS256uses a shared secret,RS256andES256use a private key with a public key for checking. - Payload — the claims: who the token is about, who issued it, for whom, until when, plus whatever custom data the app adds (roles, tenant, scopes).
- Signature — computed over the first two parts. Change a single character of the payload and the signature no longer matches.
Base64url is the URL-safe variant of Base64: - and _ replace + and /, and the = padding is dropped, so the token survives in URLs and headers. Decoding it back is trivial, which is why reading a JWT proves nothing about whether it is genuine.
The claims you will see most
| Claim | Meaning | Example value |
|---|---|---|
sub | Subject — usually the user ID | "user_8412" |
iss | Issuer — who created the token | "https://auth.example.com" |
aud | Audience — which API it is meant for | "api.example.com" |
exp | Expiry time, Unix seconds | 1767225600 |
iat | Issued-at time, Unix seconds | 1767222000 |
nbf | Not valid before, Unix seconds | 1767222000 |
jti | Unique token ID, used for revocation lists | "b3c1…" |
The times are seconds since 1 January 1970 UTC. In the example, exp: 1767225600 is 1 January 2026, 00:00:00 UTC, and iat is exactly 3,600 seconds earlier — a token with a one-hour lifetime. The decoder does this arithmetic for you; for any other timestamp, the Unix Timestamp Converter helps.
A common slip in hand-built tokens: writing exp in milliseconds (13 digits, as JavaScript's Date.now() returns) instead of seconds (10 digits). The token then appears to expire tens of thousands of years from now.
Why a request is rejected even though the token decodes
| Symptom | Check | Typical cause |
|---|---|---|
| 401 right after login | nbf and iat in the future? | Server and client clocks disagree by a few seconds or minutes |
| 401 after a while | Badge says Expired | The access token's lifetime ran out; the app should refresh it |
| 401 although "Not expired" | aud and iss | Token issued for a different API or environment (staging vs production) |
| 401 although everything looks right | Header alg, the key in use | Signature check fails: wrong secret, rotated key, wrong algorithm configured |
| 403 instead of 401 | Custom claims like role, scope | Token is valid, but lacks the permission the endpoint needs |
The badge uses your computer's clock. If your clock is off, it can disagree with the server even on a perfectly fine token.
Decoding versus verifying
Decoding answers "what does this token claim?". Verifying answers "can I believe it?", and only the second one should ever grant access. Server-side, that means:
- Verify with a maintained library and pin the algorithm you expect, rather than trusting whatever
algthe header names. Tokens with"alg": "none"or a swapped algorithm are a classic attack. - Check
exp,nbf,issandaudevery time, not just the signature. - Keep secrets and private keys on the server. Any page that asks you to paste a signing secret to "verify" a token is asking for the one thing that lets someone forge new tokens.
Because the payload is readable by anyone holding the token, treat it like a postcard: user IDs and roles are fine, passwords and personal data are not. If you want to see how the SHA-256 digests behind HMAC signatures behave, the Hash Generator computes them.
Frequently asked questions
Related tools
All Developer tools →- Base64 Encoder / DecoderEncode text to Base64 or decode it back — instantly and privately in your browser.
- Hash GeneratorGenerate SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text — privately in your browser.
- JSON FormatterFormat, beautify and minify JSON with instant validation — all in your browser.
