By Mian Shafiq · Published
Decoding a JWT online is safe if the tool decodes it inside your browser and the token is a test token or already expired. The risk isn't the decoding, which anyone can do; it's handing a live token to a website that might log it. A valid JWT works like a password until it expires. Here's how to tell whether a decoder keeps your token local, what to look for once it's decoded, and how to decode one without any website at all.
Almost never. A normal JWT is signed, not encrypted. Its header and payload are JSON written in base64url, which is just a way of encoding text, so anyone holding the token can read every claim in it: user ID, email, roles, expiry. The signature only proves the contents haven't been changed. That's why you should never put passwords or other secrets inside a JWT payload. Encrypted tokens do exist (JWE, with five dot-separated parts instead of three), but they're much rarer.
Whoever receives a live token can use it. Most APIs accept a JWT as a "bearer" token: whoever bears it is treated as the user, with no further check, until it expires. If a decoder site sends your token to its server and keeps it in a log, anyone with access to that log can call your API as you until the token runs out. Access tokens often last 5 minutes to an hour; refresh tokens can last weeks.
The decoding itself leaks nothing extra. The question is only whether the token leaves your device.
Our JWT Decoder passes this test: decoding and signature checks use the browser's built-in Web Crypto, and the token is never sent anywhere.
No. Decoding only reads it. To show the difference, we took a token signed with HS256, changed its role claim from "admin" to "superadmin" and re-encoded it. It decoded perfectly, and looked completely normal. Only verifying it with the secret revealed the problem: "Invalid signature". Any code that reads claims from a token without verifying it first can be fooled this way.
| Token we tested | Decodes? | Verifies? |
|---|---|---|
| Signed with HS256, correct secret | Yes | Yes |
| Same token, wrong secret | Yes | No |
| Same token, one claim edited | Yes | No |
| Signed with RS256, PS256, ES256 and ES384, matching public keys | Yes | Yes |
| alg set to "none", no signature | Yes | Nothing to verify: reject it |
Date.now(), which is in milliseconds, so every token looks valid forever. Divide by 1,000 first.In Node.js, one line:
JSON.parse(Buffer.from(token.split('.')[1], 'base64url').toString('utf8'))
In a browser console, avoid the popular atob() one-liner if the token might contain non-English text. atob returns raw bytes as characters, so names in Urdu, Arabic or with accents come out garbled. Our test token contained اردو ٹیسٹ, and the atob version mangled it. This version decodes UTF-8 properly:
const p = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');
const bytes = Uint8Array.from(atob(p), c => c.charCodeAt(0));
JSON.parse(new TextDecoder().decode(bytes));
To read the exp value as a date, paste it into the Unix Timestamp Converter.
Run the Network-tab check above on any decoder you use, jwt.io included, and decide for yourself. Whatever the site, the same rule applies: prefer test or expired tokens, and never paste a production signing secret.
They can change it, but a server that verifies signatures will reject the changed token, as our edited-claim test showed. They can't create a valid new signature without the secret or private key.
Log out, or revoke the session in the app, so a new token is issued. If it was a long-lived refresh token or an API key, rotate it.
That's a trade-off with no single answer. HttpOnly cookies keep the token away from JavaScript (and from XSS attacks) but need CSRF protection; localStorage is simpler but readable by any script on the page. Keeping access tokens short-lived limits the damage either way.