JWT Decoder

Decode a JSON Web Token and see straight away whether it has expired. Read the header and claims, and check an HS256 signature with a test secret. Everything runs in your browser.

  • Expiry shown at a glance
  • Accepts "Bearer ..." headers
  • Nothing is uploaded

Decoded in your browser. The token is never sent anywhere.

Advertisement

What is inside a JWT

A JSON Web Token is three pieces of text joined by dots. The first is the header, which says how the token is signed. The second is the payload, a set of claims such as who the token is for and when it expires. The third is the signature. The header and payload are just JSON written in Base64URL, so anyone can decode them, which is what this tool does.

Reading the result

The coloured banner answers the question people usually come with: is this token still valid? It compares the exp and nbf claims with your device's clock and says how long ago the token expired, or how long it has left. Below it you will see the header and payload as formatted JSON, then the standard claims in plain words, with every time shown in your local time and in UTC.

  • iss is the issuer, the service that created the token.
  • sub is the subject, usually the user ID.
  • aud is the audience the token is meant for.
  • iat, nbf and exp are the issued-at, not-before and expiry times.
  • jti is a unique ID for the token.

Decoded does not mean trusted

Because the payload is only encoded, never put secrets in it. And because anyone can build a token with any payload, a server must check the signature before it believes any claim. This tool can check HS256, HS384 and HS512 signatures if you give it the shared secret, which is a convenient way to confirm that a token and a secret belong together. Use test secrets for this. For RS256 and similar algorithms, verification needs the public key and should be done in your own code.

Be especially wary of tokens with alg set to none. They carry no signature, and a service that accepts them accepts forged logins.

Common problems

Most confusing results come from a few things:

  • Pasting a whole header: "Bearer eyJ..." works here, but not in most libraries, which want the token alone.
  • Line breaks added when a token is copied from a log or email. They are removed automatically here.
  • Milliseconds instead of seconds in exp. JWT times are seconds, so a value with 13 digits is wrong.
  • Clock differences between the machine that issued the token and the one checking it.

Frequently asked questions

Is my token sent anywhere?

No. The token is decoded in your browser and never uploaded. A token is still a credential that works until it expires, so avoid pasting live production tokens into any website you do not need to.

Is decoding the same as verifying?

No. A JWT is encoded, not encrypted, so anyone who has it can read its contents. Verifying checks the signature, which proves the token was issued by someone holding the key and has not been changed.

Can it verify the signature?

Yes for HS256, HS384 and HS512, using the shared secret. Tokens signed with RS256, ES256 and similar algorithms are checked with a public key, which this tool does not handle, so verify those in your own code.

Why does it say expired when my server still accepts the token?

The tool compares the exp claim with your device's clock. Servers often allow a few minutes of leeway, and clocks can differ. Check that exp is in seconds, not milliseconds.

Why does it say my token has five parts?

A token with five parts is an encrypted JWT (JWE). Its contents cannot be read without the decryption key.

What are iat, nbf and exp?

They are times, written as seconds since 1 January 1970 UTC: when the token was issued, the earliest time it is valid, and when it expires. The tool shows each in your local time and in UTC.

What does "alg: none" mean?

It means the token has no signature at all. Anyone can create such a token with any contents, so a server must never accept it as proof of identity.

More tools like this

All tools →