Skip to the content

JWT Decoder

Read the header and payload of a JSON Web Token, with the dates made readable.

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

What is in a JSON Web Token

A JWT is three pieces of text with dots between them. The tool gives each its own color.

PartWhat it holds
HeaderA small JSON object that says how the token was signed, for example {"alg":"HS256","typ":"JWT"}.
PayloadA JSON object with the claims: who the token is about, who issued it, when it runs out, and anything else the issuer wanted to say.
SignatureA code calculated from the first two parts and a key.

Header and payload are written in Base64URL, which is ordinary Base64 with - and _ in place of + and / so that the token fits in a URL or an HTTP header. A token of five parts instead of three is a JWE, the encrypted kind; this tool can show its header and nothing more.

Encoded, not encrypted

Base64URL is a way of writing bytes down. It hides nothing: this page turns it back into JSON without knowing any key, and so can anyone who gets hold of the token. Never put a password, a card number or anything else that should stay private in a JWT.

What the signature gives you is the opposite of secrecy. Nobody can change the payload, say from "role":"user" to "role":"admin", and still have a signature that fits, unless they have the key.

Decoded is not verified

Because reading needs no key, a decoded token proves nothing. Anyone can type a payload and encode it. The token only means something once its signature has been checked:

  • HS256, HS384, HS512 use one shared secret to sign and to check. Type the secret under the signature.
  • RS, PS and ES algorithms sign with a private key and are checked with the public one. Paste the public key as PEM, as a JWK, or paste the whole key set that the issuer publishes; the key with the matching kid is picked.

A header that says "alg":"none" means there is no signature at all. Software that accepts such a token lets anyone forge a login with nothing more than a text editor, so the tool flags them.

exp, nbf and iat

These three are moments in time, written as the number of seconds since 1 January 1970, 00:00 UTC. An iat of 1516239022 is 18 January 2018 at 01:30:22 UTC. The tool shows each in your own time zone and in UTC.

  • exp: from this moment on the token must be refused.
  • nbf: before this moment it must be refused.
  • iat: when it was issued. Informative; it does not limit anything by itself.

The usual mistake is milliseconds. JavaScript's Date.now() counts in milliseconds, and an exp filled with that lies more than fifty thousand years ahead when read as seconds, so the token never expires. You get a warning when a value looks like that.

The status line compares these times with the clock of your computer. Servers do the same with theirs, often allowing for a small difference between clocks.

Should you paste a real token into a website?

Normally not. A JWT is a key: until it expires, whoever holds it can act as you, and a site that sends your token to its server could keep it.

This page does not send it anywhere. The token is decoded by code running in your browser, the signature is checked there too, and neither the token nor the secret is stored. You can confirm that in the network tab of your browser's developer tools: pasting a token causes no request. Even so, an expired token or one from a test account is the better habit.

See all 12