A long string of letters, dots and dashes lands in a bug report, and someone asks: what is this thing, and can we trust it? That string is very likely a JSON Web Token, the format APIs use to carry identity between services. It looks like gibberish, yet most of it is perfectly readable once you know how it fits together.
This guide explains what a JWT is, what its three parts do, and how authentication flows use it, and draws the line that matters most: reading a token and trusting a token are different operations, and confusing them is a genuine security mistake. The JWT Decoder shows the header and payload of any token in plain JSON.
Contents
- Quick answer
- The three parts of a JWT
- Claims: statements the issuer makes
- How bearer authentication uses a JWT
- How to read a JWT, step by step
- Worked example: the classic demo token
- Limitations: reading is not trusting
- Common mistakes
- FAQs
- Conclusion
Quick answer
A JWT (JSON Web Token) is a token made of three dot-separated parts: a header, a payload and a signature. The header names the algorithm and the token type. The payload holds claims, statements about the user such as the subject, the issuer and the expiry. The signature is created by the issuer with a secret or a private key. The header and payload are encoded, not encrypted, so anyone holding the token can read them. Trust comes only from verification: a server checks the signature against the signing key or the issuer's public key before believing the claims. You can read any token with the free JWT Decoder, which shows the header and payload in plain JSON and labels the signature as not verified.
The three parts of a JWT
A JWT is one string with two dots in it, dividing it into three segments.
The first segment is the header, a small JSON object naming the algorithm used to sign the token and the token type. The second is the payload, another JSON object, and the part people actually want to read: it carries the claims. The third is the signature, produced by the issuer from the first two segments and a key.
The header and payload use an encoding any computer can reverse. Encoding is a formatting step, not a protection step: it makes structured data safe to carry in a URL or a header, and it hides nothing. The signature is the only part that protects the token. If anyone changes a claim in the payload, the signature no longer matches, and a verifying server can tell. Without the right key, though, nobody can run that check, which is why a decoder can show you a signature yet never tell you whether it is good.
Claims: statements the issuer makes
The payload is a set of named claims. A claim is a statement the issuer makes: this token is about this user, I issued it, it expires at this time. Some claim names are registered, with agreed meanings across systems. The ones you will meet most often are sub, the subject, usually the user id; iss, the issuer; aud, the intended audience; exp, the expiry; and iat, the issued-at time.
Two of the time claims are worth a second look. The exp and iat values are seconds since the Unix epoch: compact and unambiguous for machines, useless for humans at a glance. That is why the decoder translates the expiry into a readable date.
A claim is just a statement. When the payload says sub is 1234567890, the issuer is asserting the token belongs to that subject. Whether you believe the assertion depends entirely on the signature, not on how tidy the JSON looks.
How bearer authentication uses a JWT
Authentication with a JWT usually follows the bearer pattern. After a user signs in, the issuer creates a token and hands it to the client. The client presents that token with its requests, and the receiving service checks it before responding. Bearer is the key word: the token is trusted because it is presented, the way a ticket is trusted because it is handed over at the door.
That pattern explains both the convenience and the risk. The service needs no session store lookup, because the token carries its own claims and its own proof. The proof is the signature: the service verifies it with the signing key or the issuer's public key, and only then treats the claims as facts. Because possession is what counts, a stolen token can be presented by whoever holds it. That is why tokens are credentials, and why the decoder here runs entirely in your browser rather than uploading the token you paste.
How to read a JWT, step by step
- Open the JWT Decoder and paste the full token, all three dot-separated parts.
- Read the decoded header, which names the algorithm and token type.
- Read the payload claims: subject, issuer, issued-at and expiry.
- Check the expiry panel for the verdict, and remember the signature warning: the signature segment is present, but it is not verified.
Worked example: the classic demo token
The well-known demo token has the header {"alg":"HS256","typ":"JWT"}. Its payload contains sub "1234567890", name "John Doe" and iat 1516239022. Read as claims: the issuer states this token is about subject 1234567890, the name claim reads John Doe, and the token was issued at epoch time 1516239022.
The demo token has no exp claim, so it carries no expiry of its own. Add an exp claim of 4000000000 and the tool reports expiry on 2 October 2096, so the token is not expired. Its signature segment is present, and the page states it is not verified: verification is a different operation from decoding and needs the signing key or the issuer's public key.
Limitations: reading is not trusting
One distinction runs through this whole guide. Decoding is not verification. Without the signing key or the issuer's public key, nobody can confirm a token is genuine, and this tool never claims to. Anyone can assemble a token with a payload claiming to be an administrator, sign it with an invented key, and it will decode into convincing JSON. Only the issuer's verification step separates that forgery from a real token.
Expiry reporting has limits too. The tool reports the exp claim exactly, but enforcement belongs to the server: some systems allow clock skew leeway of a minute or two, and some ignore exp for specific flows. A token can therefore read as expired in the decoder while an application still accepts it. Neither reading is a bug; the claim and the policy are different things.
Common mistakes
- Believing a token because it decoded. Decoding shows claims; verification proves them. A readable payload is not evidence by itself.
- Putting secrets in the payload. The payload is encoded, not encrypted, and anyone holding the token can read it. Keep sensitive data out of it.
- Treating tokens casually. Tokens are credentials. Do not post them in public places or screenshots, and prefer decoders that run locally.
- Reading epoch times by eye. exp and iat are seconds since the Unix epoch. Let the tool translate them instead of guessing at dates.
- Assuming a missing exp means a broken token. Tokens without an exp claim are reported as having no expiry of their own, which is common for some API tokens.
FAQs
What does JWT stand for, and what is it? JWT stands for JSON Web Token. It is a compact token format made of three dot-separated parts: a header, a payload of claims, and a signature. APIs use it to carry statements about a user, such as the subject, the issuer and the expiry, from the issuer to the services that need them.
Is a JWT encrypted? No. The header and payload are encoded, not encrypted, and anyone holding the token can decode and read them. That is why a token should never carry secrets in its payload, and why tokens themselves are treated like credentials.
What is the difference between decoding and verifying a JWT? Decoding reverses the encoding so you can read the header and payload. Verifying checks the signature against the signing key or the issuer's public key to confirm the token is genuine and unchanged. A decoder page does not have that key, so it can decode but never verify.
What are sub, iss and aud? Registered claim names: sub is the subject (usually the user id), iss is the issuer, aud is the intended audience, exp the expiry, iat the issued-at time.
Can the JWT Decoder confirm a token is genuine? No, and be suspicious of any decoder that implies it can. Verification needs the secret or public key used to sign the token, which a decoder page does not have. The tool decodes and labels the signature as not verified.
Conclusion
A JWT is a small, readable package: a header naming the algorithm and type, a payload of claims the issuer makes, and a signature that lets a server check those claims before trusting them. The JWT Decoder shows you the first two parts in plain JSON, translates the expiry, and is honest about the third: the signature is not verified. When the question is narrower, namely when a token runs out, the companion guide covers the exp claim on its own.
Related guide: How to Check When a JWT Expires Using the exp Claim.
More tools for this kind of work live in the Developer Tools archive.