Skip to main content

JWT Decoder & Inspector

Available
Security

Decode JWT headers and payloads, inspect claims, check expiry, and identify potential security issues — directly in your browser.

JWT Decoder & Inspector tool

What to know before you rely on a result
  • Decoding is not verification. Reading a token does not show it is genuine; only a signature check against the right key can, and even that does not make it trusted or authorized.
  • A JWT payload is usually only encoded, not encrypted, so anyone who has the token can read it.
  • Expiry checks use the token's own claims and this device's clock.
  • A token that decodes cleanly may still be forged, revoked, or meant for a different service.
  • The token is processed in your browser and is not intentionally sent to any server.

Everything on this page runs in your browser. The token, its claims and any key you enter are never sent to DevCraftKit or any other server, never written to local storage, cookies or the URL, and never passed to analytics. Closing or reloading the page discards them. Key URLs inside a token (jku, x5u) are shown but never fetched.

Processed locally · No token upload

0 / 1,048,576 characters

Examples are synthetic: fictional issuers, filler signatures, no real credentials. They use the same parser as your own tokens.

Paste a token to inspect it

You will get the decoded header and claims, a claim-based expiry check, signature details and a list of things worth reviewing. Or load a synthetic example to try it.

About JSON Web Tokens

What is a JWT?

A JSON Web Token (JWT, RFC 7519) is a compact way to carry a set of claims between two parties, most often to say who someone is or what an application may do for them. In its usual signed form it is one line of text made of three Base64url segments separated by dots: header.payload.signature. Servers issue them after login, and clients send them back, typically in an Authorization: Bearer header.

A JWT is self-contained, which is why it is convenient and also why it needs care: whoever holds a valid token can use it, and everything in a signed token can be read by whoever holds it.

How to decode a JWT

  1. Copy the whole token. If it came from an Authorization header, the "Bearer" prefix is optional here.
  2. Paste it into the box above and choose Inspect token, or turn on live inspection.
  3. Read the Overview for the status and time checks, then the Header and Payload tabs for the decoded JSON.
  4. Open Security Analysis for findings, and Signature if you want to check the signature with a key you supply.

Decoding means splitting on the dots, reversing the Base64url encoding of each segment, and parsing the first two as JSON. No key is needed, which is the point: it shows readability, not authenticity.

Understanding the JWT header and payload

The header describes the token. alg names the signing algorithm, typ is usually JWT, and kid hints at which key was used. Other parameters such as jku, jwk, x5u and x5c point to or carry keys, and crit lists extensions a verifier must understand. All of these are chosen by whoever made the token, so a verifier must not simply believe them.

The payload holds the claims. Some are registered with standard meanings, some are common conventions, and the rest are private to an application. This tool labels each claim as registered, common or custom, and never invents a meaning for a custom one.

JWT claims explained

  • iss (issuer): who says they issued the token.
  • sub (subject): who or what the token is about.
  • aud (audience): who the token is meant for, as a string or an array of strings.
  • exp (expiration time): the moment the token stops being acceptable.
  • nbf (not before): the moment it starts being acceptable.
  • iat (issued at): when it was issued.
  • jti (JWT ID): a unique identifier. Having one does not by itself prevent replay.

Common claims such as scope, roles, client_id, azp, nonce and sid are conventions that differ between identity providers, so check your issuer's documentation.

How JWT expiration works

exp, nbf and iat are NumericDate values: seconds since 1970-01-01 UTC, not milliseconds. A token whose exp equals or precedes the current time is expired, and one whose nbf is still in the future is not valid yet. A common bug is issuing milliseconds, which makes a token appear to expire thousands of years from now; the tool flags values that look like that.

The check here compares claims with this device's clock and is labelled claim-based. A token inside its window can still be forged, revoked or meant for someone else, and clock differences of a few seconds between machines are why many verifiers allow a small tolerance, which you can set explicitly.

Decoding versus signature verification

Verification recomputes or checks the signature with a key and confirms that the token was made by a holder of that key and has not been changed. It is a different job from decoding. Even a successful verification establishes only that the signature matches the key you supplied. It does not establish that you should trust that key's owner, that the token is for your service, that it has not been revoked, or that it authorizes anything.

A well-known family of mistakes comes from letting the token choose how it is verified. An unsecured token with alg set to none carries no signature at all, and algorithm-confusion attacks re-sign a token with HMAC using a public key as the secret. A safe verifier decides in advance which algorithms and keys it accepts. This tool's optional verification follows that rule: the key you choose decides which algorithms are allowed.

Signed JWTs versus encrypted JWTs

A signed token (JWS) is readable but tamper-evident, with three segments. An encrypted token (JWE) hides its claims from anyone without the key and has five segments: protected header, encrypted key, initialization vector, ciphertext and authentication tag. There are also JSON serializations of both, which look like objects rather than a dotted string.

This tool decodes compact signed tokens, shows the protected header of compact encrypted tokens, and explains the JSON forms without decoding them. It does not decrypt anything.

Common JWT errors and troubleshooting

  • Wrong number of segments: a signed token has exactly three. Two usually means the signature was cut off; more than three can mean two tokens were pasted together.
  • Invalid Base64url character: look for plus or slash signs (standard Base64 rather than Base64url), spaces or line breaks.
  • Payload is not JSON: the segment decoded but the text is not an object, or it is encrypted or compressed.
  • Signature does not match: check the secret's exact characters and encoding, including a stray trailing newline, and make sure you are using the right key for that issuer.
  • Token looks expired or not yet valid: compare clocks, and confirm exp and nbf are in seconds.
  • Looks like a random string: opaque tokens are not JWTs and cannot be decoded; the issuer validates them.

JWT security best practices

  • Verify the signature on every token, with an explicit allow-list of algorithms and keys you configured, and reject alg: none.
  • Check iss, aud, exp and nbf against your own expected values.
  • Do not fetch keys from URLs inside the token, and do not trust keys embedded in it.
  • Keep tokens short-lived and have a plan for revocation.
  • Never put secrets or unnecessary personal data in a signed token.
  • Use long random secrets for HMAC, and prefer asymmetric keys when many parties must verify.
  • Do not log full tokens or put them in URLs.

For more background, read JWT explained.

Related DevCraftKit tools

Did this help you make sense of a token?

If these free developer tools save you time, consider buying me a byte. Your support helps keep DevCraftKit free and growing.

Buy me a byte 💾

Resources

View all

Explore more developer tools

Browse the full collection, or see everything in Security.

JWT Decoder & Inspector FAQ

What is a JWT decoder?
A JWT decoder reads a JSON Web Token and shows what is inside it. A signed token is three Base64url-encoded parts separated by dots: a header that describes the token, a payload of claims, and a signature. The decoder reverses the encoding so you can read the header and claims as JSON. This one also explains each claim, converts timestamps into readable dates, and lists things worth reviewing. Decoding only reads the token. It does not prove the token is genuine.
Is decoding a JWT safe?
Decoding itself changes nothing and does not make a token more or less secure, because the contents were never secret. What matters is where you decode it. This tool runs entirely in your browser, so the token is not intentionally sent to a server. Still treat live tokens as credentials: a token that has not expired can often be used by anyone who has it, so avoid pasting production tokens into tools you do not trust, and prefer short-lived or test tokens.
Can anyone decode a JWT?
Yes. The header and payload of a signed JWT are only Base64url-encoded, not encrypted, so anyone who has the token can read them. The signature does not hide anything; it only lets a verifier detect changes. Never put passwords, secrets or sensitive personal data in a signed token. If the contents must stay private, use an encrypted token (JWE) or keep the data on the server.
Is a JWT encrypted?
Usually not. The common JWT is a signed token (JWS), whose contents are readable by anyone holding it. An encrypted token (JWE) also exists and has five segments instead of three. This tool recognizes a compact JWE and shows its protected header, but its claims cannot be read without the decryption key, and the tool does not decrypt tokens.
What does an expired JWT mean?
It means the token's exp claim, a time in seconds since 1970, is at or before the current time on the device doing the check. A correct verifier rejects the token, and you normally need to request a new one. The check depends on the claim being accurate and on the clock being right: if your device clock is wrong, or the issuer's clock differs from the verifier's, the result can be wrong. This tool labels its result a claim-based temporal assessment for that reason.
How do I check a JWT's expiration?
Paste the token and open the Overview tab. It shows exp as the original number, as a UTC time and as your local time, and says whether it is expired or how long remains. It also checks nbf (not before) and iat (issued at) and flags contradictions such as an expiry earlier than the issue time. You can add a clock-skew tolerance if you want to mirror a verifier that allows for small clock differences; the default is exact comparison.
What is the difference between JWT decoding and verification?
Decoding turns the encoded segments back into readable JSON. Verification checks the signature with the correct key to confirm the token was produced by someone who holds that key and was not changed. Decoding needs no key and proves nothing about authenticity. Verification needs a key, and even a successful signature check does not tell you that the issuer is trusted, that the token is meant for you, that it has not been revoked, or that it authorizes any action.
Can I trust a JWT after decoding it?
No. Any claim in an unverified token, including sub, iss, aud and role claims, may have been written by an attacker, because anyone can create a token with any contents. Trust comes from verifying the signature with a key you already trust, checking the issuer, audience and expiry against your own expected values, and enforcing authorization on the server. Decoding is for inspection and debugging only.
What is the difference between JWS and JWE?
A JWS is a signed token: its content is readable but protected against changes. A JWE is an encrypted token: its content is hidden from anyone without the key. Both have a compact form made of Base64url segments joined by dots. A compact JWS has three segments and a compact JWE has five. Both also have a JSON serialization, which this tool recognizes and explains but does not decode.
Why does my JWT have five segments?
Five segments means it is almost certainly an encrypted token (compact JWE): protected header, encrypted key, initialization vector, ciphertext and authentication tag. The claims are inside the ciphertext, so they cannot be shown without decrypting. The tool shows the protected header, which tells you the key-management algorithm and the content encryption algorithm in use.
Why is my JWT malformed?
Common causes are: copying only part of the token, extra or missing dots, a line break or space inside it, quotation marks or a Bearer prefix around it, characters that are not Base64url such as plus and slash signs, a payload that is not valid JSON, or pasting something that is not a JWT at all, like an opaque API key. The tool reports which check failed rather than calling everything invalid. It removes only surrounding quotes, a Bearer prefix and line-wrapping whitespace, tells you when it did, and never repairs anything else.
What do iss, sub, aud, exp, nbf and iat mean?
These are registered claims. iss is the issuer, sub is the subject the token is about, and aud is the audience it is intended for, either one string or an array. exp is the expiration time, nbf is the time before which the token must not be accepted, and iat is when it was issued. The three times are numbers of seconds since 1970-01-01 UTC. Their values are only claims until the signature is verified, and what counts as the right issuer or audience depends on your application.
Can this tool verify a JWT signature?
Yes, optionally and locally, when you supply the key. It supports HS256, HS384 and HS512 with a shared secret, RS256, RS384, RS512, PS256, PS384 and PS512 with an RSA public key, ES256, ES384 and ES512 with an EC public key, and EdDSA with an Ed25519 key where your browser supports it. Keys can be a PEM public key or a JWK. It uses your browser's built-in cryptography, and the key type you choose decides which algorithms are allowed, so a token cannot pick its own. It does not accept private keys or certificates, never downloads keys from URLs in the token, and cannot verify tokens that use alg none, critical extensions or unencoded payloads. A successful result means only that the signature matches your key.
Is my JWT sent to a server?
No. Decoding, analysis, and optional signature verification all run in your browser. The token, the claims and any key you enter are not sent to DevCraftKit or any other server, are not written to local storage, cookies or the address bar, and are not passed to analytics. Closing or reloading the page discards them. The site loads its usual page-level scripts such as analytics, but token contents are never given to them. Header values like jku and x5u are shown as text and are never fetched.
What should I do if my token contains sensitive information?
Remember that anyone with the token can read it, so treat the token as sensitive too. Remove data that does not need to travel in it, such as email addresses, phone numbers, internal identifiers and above all credentials. If some data must be included but kept private, use an encrypted token or look it up on the server by an opaque identifier. If a token that held secrets has been shared or logged, rotate whatever it exposed and revoke the token. The tool's sensitive-data check is a pattern-based hint and will miss things.

Found a bug or an incorrect result in JWT Decoder & Inspector?

Report it, or suggest an improvement. Messages go straight to the developer.

Send feedback