What is a JWT decoder?
A JWT — a JSON Web Token — is a small, signed package of information that websites pass around to prove who you are. When you log in somewhere, the server often hands your browser a token, and the browser sends it back with every request. The token has three parts, separated by dots: a header, a payload, and a signature. A decoder opens the first two parts so you can read what is inside.
The default token on this page is the classic example from the JWT specification. Its payload says the subject is 1234567890, the name is Ada Lovelace, and the token was issued at 1516239022 — a Unix timestamp that works out to 18 January 2018. Its header says the signing algorithm is HS256 and the type is JWT. All of that is readable by anyone who has the token, because the header and payload are only encoded, not encrypted.
That last point is the one people get wrong most often. Encoding is not encryption. Base64url encoding scrambles text into a form that travels safely in a web address, but anyone can reverse it — which is exactly what this tool does. A JWT payload must never contain a password, a secret, or anything else you would not show a stranger, because a stranger who gets the token can read it.
This decoder does one job and says so plainly: it decodes. It does not verify the signature, so a token that decodes cleanly here is not necessarily a token a server would accept. Verification needs the secret key or the public key that signed it, and this page never asks for those — decoding is safe precisely because it needs no keys at all.
How this JWT decoder works
The decoder splits the token on its dots. A well-formed JWT has exactly three parts: header, payload, and signature. If the token has one part, or two, or four, the result is a clear No for decodes cleanly, and the parts count shows what was actually there. The classic example has 3 parts, which is the first thing the tool checks.
Each of the first two parts is base64url-decoded. Base64url is the web-safe cousin of base64: it uses a hyphen instead of a plus, an underscore instead of a slash, and it leaves off the padding equals signs. The decoder restores the standard characters, adds the padding back, and converts the result from bytes to text, handling multi-byte characters properly so names in other scripts decode correctly too.
The decoded text is then parsed as JSON and printed with indentation. The header of the default token prints as two lines — alg HS256, typ JWT — and the payload prints as three lines, with the subject, the name, and the issued-at timestamp. If either part is not valid JSON, the decode fails and the result says so, instead of showing garbage.
The signature, the third part, is not decoded at all, because it is not JSON — it is a cryptographic signature over the first two parts, and its contents are meaningless without the key. The tool shows the parts count so you can confirm the signature is present, but it never claims to check it. That is the boundary of what a decoder can honestly do.
The numbers: parts, algorithm, and validity
Three results describe the token. Parts is the count of dot-separated pieces — 3 for a well-formed token, 1 for a bare word like hello, which is not a token at all. Signing algorithm is the alg field from the header — HS256 in the default — or a dash when the header cannot be read. Decodes cleanly is Yes when both the header and the payload decode and parse as JSON, and No otherwise.
The default token gives Yes, HS256, and 3. A token with a valid structure but a payload that is not JSON gives No, with the algorithm still shown if the header parsed — because the header and the payload are decoded independently, and one can be fine while the other is broken. That separation is useful when debugging: it tells you which half of the token is the problem.
The issued-at timestamp in the payload deserves a note. The value 1516239022 is seconds since 1 January 1970, the Unix epoch, and it converts to 18 January 2018. Tokens often carry an expiry timestamp too, usually called exp, and a server rejects a token whose expiry has passed. This decoder shows the numbers as they are; working out whether a token has expired is a matter of comparing exp with the current time, which the payload makes easy to do by eye.
What the numbers never tell you is whether the token is genuine. A token made up by hand with a correct structure decodes cleanly and shows a plausible algorithm, and this tool will say Yes — because decoding is not verifying. Only the server that holds the signing key can tell a real token from a forged one, and that check happens on the server, never in a decoder.
A worked example: reading the classic token
Paste the default token and read the header first. It decodes to {"alg": "HS256", "typ": "JWT"} — the token is signed with HMAC-SHA256, and it declares itself a JWT. The algorithm matters, because it tells the server which verification method to use, and a token that claims an algorithm the server does not support will be rejected.
Then the payload: {"sub": "1234567890", "name": "Ada Lovelace", "iat": 1516239022}. The subject is a user identifier, the name is a display name, and iat is the issued-at time. These are claims — statements the token makes about its subject — and a real token carries the claims its application needs: a user id, a role, an expiry, and little else.
Try a second token to see the same shape with different claims: the header is identical, and the payload is {"sub": "42", "name": "Bob", "admin": true}. It also decodes cleanly, with algorithm HS256 and 3 parts. The difference is only in the claims — a different user, an admin flag — which is exactly how tokens vary in real use while keeping the same structure.
Now try the failure cases. The word hello has 1 part, so it decodes to No with a dash for the algorithm. The string not.a.token has 3 parts, but neither of the first two decodes as JSON, so it also gives No. Both failures are reported plainly, with the parts count showing what the tool actually found.
Who decodes JWTs, and why
Developers decode tokens while building login systems, because the token is the thing that proves a user is logged in, and seeing its claims is the fastest way to check the login is working. If a page shows the wrong user, or an admin flag that should not be there, the payload is the first place to look — it shows exactly what the server put in the token.
Support teams decode tokens when a user reports a login problem. A token that decodes cleanly but carries an expired timestamp explains a session that keeps ending. A token with the wrong subject explains a user seeing someone else's data. The decoder turns a cryptic string into a readable explanation in seconds.
Security reviewers decode tokens to check what they contain. A token carrying a password, a full address, or a secret would be a serious problem, and it is visible the moment the token is decoded. The review takes seconds, and it catches a class of mistake — putting sensitive data in a token — that is easy to make and hard to spot any other way.
Learners use a decoder to understand how authentication works on the modern web. The idea that a login can be a self-contained, signed package — rather than a session stored on a server — is unfamiliar at first, and reading a real token makes it concrete: a header, some claims, and a signature, each with a job to do.
JWT decoder vs a token verifier
The honest difference is the signature. A decoder reads the header and payload. A verifier checks the signature against the key that signed the token, and only then trusts the claims inside. This page is a decoder, and it never pretends to be a verifier — the formula line states it, the output box repeats it, and the FAQ says it again.
That boundary is what makes a decoder safe to use in a browser. Verification needs a secret key, and a secret key must never be pasted into a web page. Decoding needs nothing but the token itself, so this page can run entirely in your browser with no keys, no server, and no risk to the secret that protects your tokens.
For the rest of the developer toolkit, the companions are close: a Base64 encoder explains the encoding the token uses, a hex encoder covers the hex encoding that signatures are often shown in, a JSON formatter formats the decoded header and payload for reading, and a password generator makes the strong secrets that signing keys should be drawn from.
If you need to verify a token, do it on your server, with the key that signed it, using a library for your language — never in a browser tool, and never by pasting the key anywhere. The decoder's job is to show you what is inside; the server's job is to decide whether to trust it.
Common JWT mistakes
The first mistake is treating a decoded token as a verified token. Decoding proves the token is well-formed; it proves nothing about who made it. Anyone can write a token with any claims in it, and it will decode cleanly. Only the signature check separates a real token from a forged one, and that check needs the key.
Second: putting sensitive data in a token. Passwords, secrets, full addresses, and payment details do not belong in a payload, because anyone who sees the token can read them. Keep tokens to identifiers and roles — a user id, an admin flag, an expiry — and fetch the sensitive data from the server when it is needed.
Third: ignoring expiry. A token without an expiry never stops working, so a stolen token works forever. Real tokens carry an exp claim and are short-lived, with a refresh mechanism to get a new one. If the payload has no exp, ask why — it is usually an oversight, and oversights in authentication are expensive.
Fourth: trusting the alg field blindly. The header says which algorithm signed the token, but a server must check that the algorithm is one it expects. A token that claims alg none — no signature at all — decodes cleanly and must be rejected by any server that checks. The decoder shows the algorithm; the server must enforce it.
How to use this JWT decoder
Paste your token into the box at the top. The classic example token is already there, decoding to Yes, HS256, and 3 parts. Replace it with your own token and the header and payload appear instantly — there is no button to press.
Read the header first, then the payload. The header tells you the algorithm and the type. The payload tells you the claims: who the token is about, when it was issued, and when it expires. The results above confirm the structure: parts, algorithm, and whether both halves decoded cleanly.
Check the note at the bottom of the output: this tool decodes only and does not verify the signature. A Yes here means the token is readable, not that it is genuine. Verify tokens on your server, with the signing key, and never paste a signing key into any web page.
Everything runs in your browser. Your token never leaves your device, is never uploaded, and is never stored. Tokens are credentials — treat them like passwords while you handle them — and closing the page removes the one you pasted.