How to decode a JWT
- Paste the token into the box above, or click Load sample to see how it looks. It decodes automatically as you type. Paste only the token itself — remove any
Bearerprefix copied from an Authorization header. - Read the header (the signing algorithm and token type) and the payload (the claims: user id, roles, expiry and so on). Both are shown as formatted JSON with a copy button.
- Check the claims table, which turns the
iat,nbfandexptimestamps into UTC dates and tells you whether the token has expired.
Anatomy of a JWT
A JSON Web Token is three base64url strings joined by dots: header.payload.signature. Base64url is base64 with - and _ in place of + and / and no trailing = padding, which keeps the token safe inside URLs and HTTP headers. The sample token decodes to a header of {"alg":"HS256","typ":"JWT"} and a payload with sub, name, role, iat and exp claims. The signature is the third segment, a cryptographic hash of the first two. It is shown as-is, because it is binary data, not readable text.
Common claims you will see
sub— the subject, usually a user id.issandaud— who issued the token and who it is meant for.iat,nbf,exp— issued-at, not-before and expiry, in Unix seconds.scope,rolesor custom fields — permissions, defined by whoever built the API.
Decoding is not verifying
Anyone holding a token can read it, because the header and payload are only encoded, not encrypted. Decoding therefore proves nothing about whether the token is genuine. Verification means recomputing the signature with the secret (HS256) or the issuer's public key (RS256, ES256) and comparing it, and it also means checking that iss, aud and expiry are what your application expects. That belongs on your server, so this page never asks for a key and shows the signature as “not verified”. A token that decodes cleanly here may still be forged, so never trust claims you have only decoded. Because payloads are readable, never put passwords or other secrets in them.
Debugging a 401 with the claims table
When an API rejects a token, check three things in order. First, expiry: the table reads “expired 3 hours ago” or “expires in 12 minutes” so you can see at once if the token simply timed out. Second, audience and issuer: a token minted for one environment, such as staging, is often rejected by another. Third, clock skew: if iat or nbf is slightly in the future relative to the server, the server may reject a brand-new token.
Limits of this tool
- It reads
iat,nbfandexponly when they are numbers in seconds. A value in milliseconds will show a date thousands of years away. - Only
expis flagged as expired or valid;nbfis displayed but not judged. - Encrypted tokens (JWE, five segments) cannot be read, because their payload is not plain JSON, and you will see an error instead.
- A token with an empty third segment (an unsigned token) still decodes, and the signature area shows “(none)”. Treat any unsigned token as untrusted.
Need to convert a timestamp from the payload by hand? Try the Timestamp Converter. To inspect other base64 text, use Base64 Encode & Decode.
Is it private and safe?
The token is decoded in your browser with JavaScript and is never uploaded, logged or sent anywhere. Many online JWT tools work differently, so check before pasting a live token anywhere. As a habit, prefer short-lived or test tokens when debugging, and treat any production token you have pasted into a website as exposed: log out or rotate it. Decoding only needs the first two segments, so you can delete the signature (the last dot and everything after it) before pasting; the claims still appear.
Related guides
Timestamps in claims are explained in Unix timestamps explained. If a payload will not parse, see how to fix JSON syntax errors, and tidy large payloads with the JSON Formatter.
Frequently asked questions
Is decoding the same as verifying?
No. Decoding only reads the base64url header and payload, which anyone can do. Verifying recomputes the signature with the secret or public key and checks claims such as issuer, audience and expiry, which must happen on your server.
Why can anyone read a JWT?
The header and payload are encoded, not encrypted, so the contents are visible to anyone who holds the token. That is why you should keep passwords, API keys and personal data out of the payload.
Is it safe to paste a production token into an online decoder?
Only if the tool decodes locally, as this one does. Even then, a live token works as a password until it expires, so prefer test or short-lived tokens, and revoke or rotate a production token you have pasted somewhere you do not fully control.
What are iat, exp and nbf?
They are issued-at, expiry and not-before times, expressed as Unix timestamps in seconds. The tool shows them as UTC dates and tells you whether the token's exp has passed.
Why does my token show as invalid?
A JWT needs at least a header and a payload separated by a dot, and each must be valid base64url that decodes to JSON. Extra text such as a Bearer prefix, line breaks inside the token, or a truncated copy will make decoding fail.
Can this tool tell me if the signature is valid?
No. Checking a signature requires the secret or public key, and this page deliberately never asks for one. The signature is displayed exactly as it appears in the token, marked as not verified.
Why does the expiry date look wrong?
JWT time claims should be in seconds. If an issuer wrongly uses milliseconds, the decoded date lands far in the future, so check the raw number in the payload. The dates shown are in UTC, not your local time zone.