Skip to content

JWT decoder

Read a JWT's header, payload and expiry in plain language.

Updated

Decoding isn't verifying. This shows what a token says, not whether it's genuine: the signature isn't checked, and anyone can create a token with any contents.

How to decode a JWT

  1. Paste the token. A leading Bearer is removed for you.
  2. Read the header (the signing algorithm) and the payload (the claims), both formatted as JSON.
  3. Check the expiry: times are shown as dates, with whether the token has expired.

Registered claims

ClaimNameMeaning
issIssuerWho created the token
subSubjectWho the token is about, usually a user ID
audAudienceWho the token is meant for
expExpirationWhen it stops being valid (seconds since 1970)
nbfNot beforeWhen it starts being valid
iatIssued atWhen it was created
jtiJWT IDA unique ID, used to prevent replay

Anatomy of a JWT

A JWT is three Base64URL-encoded parts joined by dots: a header saying how it's signed, apayload of claims, and a signature. The server signs the first two parts with a secret or private key; changing a single character of the payload makes the signature fail. That protects the contents from tampering, but not from being read.

Common uses

  • Debugging a failed login. When an API answers 401 Unauthorized, paste the token to check whether it has expired or was issued for a different audience.
  • Checking what a token contains. See which user ID, roles or scopes your identity provider put in a token before writing code that relies on them.
  • A token from the Authorization header. Copy a token straight from your browser's developer tools, Bearer prefix and all, and read it without writing a script.

Questions

Does this check that the token is valid?

No. It decodes the token so you can read it, but it doesn't verify the signature. A decoded token can say anything; only your server, using the secret or public key, can confirm it's genuine.

What do exp, iat and nbf mean?

They're times in seconds since 1 January 1970 (UTC). exp is when the token expires, iat is when it was issued, and nbf is the earliest time it may be used. The decoder shows them as dates and says whether the token has expired.

Why can anyone read a JWT?

A standard signed JWT is only Base64URL-encoded, not encrypted. The signature stops tampering, not reading. Never put secrets such as passwords in a JWT's payload.

Why won't my token decode?

A signed JWT has exactly three parts separated by dots. Tokens with five parts are encrypted (JWE) and can't be read without the key. Copying only part of a long token is also a common cause.