A JSON Web Token (JWT) looks like a random string. It isn’t. Anyone who holds one can read most of it in seconds, and that’s exactly why you should be careful where you paste it.
This post covers what a JWT is made of, the difference between decoding and verifying, and how to do both safely with our free JWT Decoder, Encoder & Verifier, which runs entirely in your browser.
What a JWT is made of
A signed JWT has three parts separated by dots:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyJ9.<signature>
header payload signature
- Header: a small JSON object that names the signing algorithm (
alg) and often a key ID (kid) and type (typ). - Payload: the claims. Who the token is about (
sub), who issued it (iss), who it’s for (aud), when it expires (exp), and anything else the issuer adds, such as roles or scopes. - Signature: computed over the header and payload with a secret or private key.
The header and payload are only Base64URL-encoded. That’s an encoding, not encryption. The format is defined in RFC 7519, and the signature format in RFC 7515.
A token with five parts instead of three is an encrypted token (JWE). Only its header is readable without the decryption key.
Decoding is not verifying
Decoding turns the header and payload back into JSON. It needs no key, proves nothing and can be done by anyone.
Verifying checks the signature with the right key. If it matches, the token was signed by whoever holds that key and hasn’t been changed since.
Even a verified signature isn’t the end of the story. A server still has to check that the algorithm is the one it expects, that the token hasn’t expired, and that the issuer and audience are right. A perfectly signed token can still be one your API should refuse. Our post on JWT mistakes we see in real APIs covers what goes wrong when those checks are skipped.
Don’t paste live tokens into tools that send them
A live access token is a credential. Whoever holds it can usually act as the user until it expires. A refresh token can last much longer.
Many online decoders run their logic on a server, log requests or load third-party scripts. Once a live token has left your machine, you can’t know where it ends up. The same goes for private keys: a production signing key should never leave your systems at all.
So use tokens from a test environment wherever you can. If you must inspect a real one, use a tool that works offline, and let the token expire or revoke it afterwards. Never paste a production private key or HMAC secret into a website.
Our tool decodes, verifies, signs and generates keys in your browser. It fetches nothing and sends nothing anywhere. We still recommend test tokens and test keys.
Step by step with the JWT tool
1. Decode
Open the JWT tool and paste the token into the Token box. An Authorization: Bearer prefix, quotes and line breaks are removed for you, so you can copy straight from a request.
The token is shown in three colours, with the header and payload as formatted JSON underneath. Try an example creates a test token with a fresh random secret if you just want to explore.
2. Read the claims
Every header parameter and claim is listed with its value and a plain-English meaning: iss is the issuer, aud the audience, scope the permissions granted, and so on. Time claims (exp, iat, nbf, auth_time) are shown as a date in your local time and as “in 2 hours” or “3 days ago”, so you don’t have to convert Unix timestamps by hand.
3. Read the findings
The Findings panel flags risky settings, sorted by severity. More on these below.
4. Verify the signature
Paste a key into Verify the signature. What goes in depends on the algorithm in the header:
- HMAC (HS256, HS384, HS512): the shared secret, as text, Base64 or hex. Pick the format from the list.
- RSA, RSA-PSS, ECDSA or EdDSA: the public key as a PEM file, an X.509 certificate or a JWK. A private key works too; the tool uses its public half.
- A whole JWK Set: the JSON an identity provider publishes at the
jwks_uriin its discovery document. The key whosekidmatches the token’s header is tried first.
The tool never fetches the JWK Set for you. Download it yourself, check it came from the provider you expect, and paste it in.
The result is one of four states: Signature verified (with the algorithm, the key type and its kid), Invalid signature, Unsigned token for alg: none, or Signature not checked with a reason, such as a key that doesn’t suit the algorithm. If an ES256 signature is the wrong length, the tool explains that JWS signatures are the raw r and s values joined together, not DER, which is a common cause of failures in hand-written code.
One limit to keep in mind: the tool checks the signature and flags risky settings, but it doesn’t know which issuer or audience your API expects. Compare iss and aud with your own configuration.
What the warnings mean
| Warning | Severity | What it means |
|---|---|---|
| Algorithm is “none” | Critical | The token is unsigned. A server that accepts it lets anyone forge tokens. |
| Weak signing secret | High | Shown after an HMAC token verifies with a secret that is shorter than the hash output, or a well-known example value. It can be cracked offline from a single token. |
| Sensitive-looking claims | High | Claim names such as password, secret, api_key or card_number. Anyone holding the token can read them. |
No expiry, or exp not a number |
Medium | A stolen token could work indefinitely. Some libraries ignore an invalid exp. |
| Very long lifetime | Medium | More than 30 days between iat and exp. Over a day is flagged as Low. |
Header contains jwk, jku or x5u |
Medium | The token carries its own key or points to one. Safe only if the server ignores these or checks them against an allow-list. |
| No algorithm in the header | Medium | The server must enforce the algorithm it expects instead of trusting the token. |
| Issued in the future | Low | iat is ahead of the current time, which usually means a clock problem at the issuer. |
Header contains kid |
Info | Normal. Worth checking that the server looks it up in a fixed set of keys and never uses it in a file path or query. |
| Symmetric algorithm | Info | HMAC is only as strong as the secret. |
Expired tokens and tokens that aren’t valid yet (nbf in the future) are noted as Info, because that’s useful context rather than a flaw.
What a decoder can’t tell you
A decoder only sees the token. It can’t show whether your API rejects an unsigned token, a tampered signature, a key it shouldn’t trust or an expired exp. That needs requests to the server itself.
If you’re working through those checks for your own API, our JWT Security Testing Guide explains what to look at. For choosing an algorithm and handling keys, see Choosing a JWT signing algorithm and JWT keys explained: PEM, JWK and JWK Sets.
Get it
- Use it free: JWT Decoder, Encoder & Verifier
- Sign and build test tokens: Encode mode
- Generate and convert keys: Keys mode
- More free tools: rudranetra.com/tools
Want your API’s token handling tested properly? See API penetration testing or get in touch.
