JWT Decoder: How to Decode a JWT Token Online and Check When It Expires

Your app suddenly returns "401 Unauthorized", a login works on one device but not another, or an API refuses a token you copied from the browser. Before you dig through code, it helps to see what the token actually says. A JWT decoder shows you the header and payload in plain JSON, and tells you if the token has simply expired.
This guide shows how to decode a JWT token online with the free JWT Decoder on DoraPDF, how to read the common claims such as exp, iat and sub, and what decoding can and cannot tell you.
What a JWT is made of
A JSON Web Token is three pieces of text joined by dots:
header.payload.signature
- Header: says which algorithm signed the token, for example
HS256orRS256, and the typeJWT. - Payload: the claims, such as who the user is, when the token was issued and when it expires.
- Signature: proof that the server created the token and nobody changed it.
The header and payload are only Base64URL-encoded, not encrypted. That is why anyone holding a token can read them, and why a decoder is so useful for debugging. (If you want to see how plain Base64 works, the Base64 tool shows the idea.)
How to decode a JWT token (step by step)
- Copy the token. In a browser you will usually find it in DevTools, under Application (local storage or cookies) or in the
Authorization: Bearer ...header of a request in the Network tab. Copy only the part afterBearer. - Open the JWT Decoder.
- Paste the token into the Input box. It is decoded as you paste; there is no button to press.
- Read the Output. You get two neatly formatted JSON blocks, marked
// HEADERand// PAYLOAD. - If the payload has an
expclaim, a card below shows Expires with the local date and time, followed by (valid) or (expired). - Use Copy to grab the decoded JSON for a bug report, or Clear to empty both boxes.
If what you pasted does not have at least two dot-separated parts, the tool shows "Not a valid JWT" instead of a result.
How to read the common claims
| Claim | Meaning | What to check |
|---|---|---|
exp |
Expiry time | Is it in the past? Then the token is no longer accepted. |
iat |
Issued at | Is it far in the future? The server or device clock may be wrong. |
nbf |
Not before | The token is not valid until this time. |
sub |
Subject, usually the user ID | Is it the user you expected? |
aud |
Audience | Does it match the API you are calling? |
iss |
Issuer | Is it your login server and not a test one? |
Times like exp and iat are Unix timestamps in seconds, which is why 1767225600 means nothing at a glance. The decoder converts exp to a readable date for you; for other time claims you can compare the numbers with exp.
Why it helps when debugging
- Fast answer to "why am I logged out?" In many cases the token has simply expired and the refresh step failed.
- Spot the wrong environment. A token from a staging server will carry a different
issoraud, and the production API will reject it. - Check roles and scopes. If a user cannot reach a page, the payload often shows a missing role or scope.
- Compare two tokens. Decode the working and the failing token side by side and look for the difference.
Important: decoding is not verifying
The tool says it plainly: the signature is not verified. Decoding only reads the header and payload. It does not prove that the token was issued by your server or that nobody edited it. A token with a perfectly readable payload can still be fake.
So use a decoder to inspect, never to trust. Your server must always verify the signature with the correct key and check exp, aud and iss before it accepts a token. Never build logic that reads a payload and grants access without verification.
Practical tips
- Treat real tokens as passwords. A valid token can often be used to act as that user until it expires. Do not paste live production tokens into chat apps, tickets or screenshots.
- Prefer test tokens for sharing. When you write a bug report, decode the token and share only the claims that matter, not the full token string.
- Do not put secrets in the payload. Because anyone can decode it, a JWT payload should never contain passwords, card numbers or private data.
- Check the clock. If a fresh token already shows as expired, compare the time on the server and the device.
Common problems and fixes
"Not a valid JWT." You probably copied extra text such as Bearer or quotes, or only part of the token. A JWT has two dots; paste the full string.
Strange characters or an error after pasting. The token may have been URL-encoded when it was put in a link (you will see things like %2E). Decode it first with the URL Encoder, then paste the clean token.
The payload is not readable at all. Some systems use encrypted tokens (JWE) with five parts instead of three. Those cannot be read without the key, which is the point of encryption.
No "Expires" card appears. The token has no exp claim. Some long-lived tokens are like that; check your server settings if that is not intended.
Privacy note
The JWT Decoder runs locally in your browser. The token is decoded on your device and is not uploaded to DoraPDF or anyone else. Even so, follow the tips above and avoid pasting live production tokens anywhere you do not control.
FAQ
Can I decode a JWT without the secret key?
Yes. The header and payload are only Base64URL-encoded, so they can be read without any key. The key is only needed to verify or create the signature.
How do I check if a JWT token is expired?
Paste it into the JWT Decoder. If it has an exp claim, the tool shows the expiry date and marks it as valid or expired based on your device's clock.
Does the decoder verify the signature?
No. It reads the token only. Signature verification must happen on your server with the right key.
Is it safe to paste my token into an online JWT decoder?
With DoraPDF the token is decoded in your browser and not sent anywhere. Still, treat real tokens like passwords and prefer test tokens when you can.
Try it now
Next time an API says "unauthorized", open the JWT Decoder, paste the token and see in seconds whether it has expired or carries the wrong claims. For the JSON you copy out, the JSON Validator helps you check and format it.
Try the tools from this guide — free
Keep reading
Free Developer Tools Online: JSON Formatter, Regex Tester, Base64, URL Encoder, JWT Decoder, SQL and UUID
Eight small browser-based developer tools for everyday debugging: validate JSON, test regex, decode JWTs and Base64, format SQL, make UUIDs. Free.
GuideBase64 Encode and Decode Explained (With Simple Examples)
What is Base64 encoding used for, how does it work, and why it is not encryption? Clear examples, plus free tools to encode, decode and read JWTs.
GuideSQL Formatter Online: Beautify a Messy SQL Query So You Can Actually Read It
Free SQL formatter online: paste a one-line query and get keywords in UPPERCASE and each clause on its own line. How it works, tips and its limits.