JWT Decoder

Paste a JSON Web Token to read its header and payload, with the exp, iat and nbf times shown as dates. The token is decoded in your browser and is not saved. The signature is shown but not verified.

How to use the JWT decoder

  1. Paste the token. A leading "Bearer " is removed for you.
  2. Press Decode to see the header and payload as formatted JSON.
  3. Check the status line for expiry, and the dates for exp (expires), iat (issued at) and nbf (not before).

Everything runs in your browser. Nothing you type is sent to our servers. The token is not saved. Even so, treat a live token like a password: anyone who has it can use it until it expires.

What is inside a JWT

A JWT has three parts separated by dots: a header, a payload and a signature. The header and payload are JSON encoded with base64url, which is an encoding, not encryption. Anyone can read them, which is why a JWT should never carry passwords or other secrets.

The signature is made from the header and payload with a secret (HS256) or a private key (RS256, ES256). It proves who issued the token and that it has not been changed, but only to someone who checks it with the right key. This tool shows the signature and does not verify it, because that needs your key, which should stay on your server.

ClaimMeaning
issIssuer: who created the token
subSubject: usually the user ID
audAudience: which service the token is for
expExpiry time, in seconds since 1 January 1970 (UTC)
nbfNot before: the token is not valid until this time
iatIssued at
jtiA unique ID for the token, used to revoke it

Verifying a token properly

In your application, use a maintained library to verify the signature and the claims together, and tell it which algorithm to expect. Do not accept tokens whose header says alg is none, and do not let the token choose its own algorithm. The tool flags alg none when it sees it.

Node.js with the jose package
import { jwtVerify } from "jose";

const secret = new TextEncoder().encode(process.env.JWT_SECRET);
const { payload } = await jwtVerify(token, secret, {
  algorithms: ["HS256"],
  issuer: "https://auth.example.com",
  audience: "my-api",
});

When you would use it

  • Finding out why an API returns 401: an expired token, the wrong audience or a missing scope.
  • Checking which claims your identity provider puts in its tokens.
  • Confirming the expiry time your login service sets.

Frequently asked questions

Does "Not expired" mean the token is valid?

No. It only means the exp time has not passed. A token is valid only when its signature is verified with the right key, which this tool does not do.

Can I decode a JWT without the secret?

Yes. The header and payload are only base64url encoded, so anyone can read them. The secret is needed to create or verify the signature, not to read the contents.

Why does my token have five parts?

That is an encrypted JWT (JWE). Its payload is encrypted, so it cannot be read without the decryption key. This tool decodes signed tokens (JWS), which have three parts.

What time zone are the dates in?

JWT times are seconds since 1 January 1970 in UTC. The tool shows them in your computer's local time.

Related tools and guides

Related Articles

Learn more about Security with our expert guides.

View all posts

This tool runs in your browser. What you enter is processed on your device and is not sent to our servers.

Building something bigger?

We design and build web and mobile applications and the APIs behind them.