CalcKit CalcKit
My Calculators
Sign in Sign up

JWT Decoder

Decode and verify a JSON Web Token online: read its header and payload with every claim explained, see when it expires and check its signature. In your browser.

Decoded Header

ParameterValue

Decoded Payload

ClaimValue

The payload isn't JSON, so it is shown as text.

Signature Verification

JWT Decoder: A Quick Guide

Paste a JSON Web Token to read what is inside it: the header, the payload with every claim explained, the dates in plain words, and whether the token has expired. Add the secret or the public key, and the decoder checks the signature too. Everything happens in your browser: the token and the key are never sent anywhere, so the page works the same offline.

What is a JWT?

A JSON Web Token (JWT, said "jot") is a small, signed piece of JSON that a server hands out after a login, and that the client then sends with each request, usually as Authorization: Bearer <token>. It has three parts separated by dots:

  • Header: the token type and the signing algorithm, such as {"alg":"HS256","typ":"JWT"}.
  • Payload: the claims, statements about the user and the token: who it is for, who issued it, when it expires.
  • Signature: made from the first two parts with the issuer's secret or private key, so that nobody can change them unnoticed.

The header and the payload are only encoded in Base64url, not encrypted. Anyone who has a token can read them, which is what this tool does. That is why a JWT should never carry a password or other secrets.

How to use the JWT Decoder

  1. Paste the token into Encoded Token. A leading Bearer , surrounding quotes and line breaks are ignored, so you can paste it straight from a header or a JSON file.
  2. Read the status under the field: expired, not valid yet, not expired, or no expiry at all.
  3. Look at the Decoded Header and the Decoded Payload, indented for reading, and copy either with its copy button.
  4. Switch either to Breakdown for a table of its fields, with every time shown as a date. Point at or tap a name to see what it means.
  5. Verify the signature under Signature Verification: paste the secret (for HS256 and the other HMAC algorithms) or the issuer's public key (for RS256, ES256 and the others). The result shows at once: Signature verified or Invalid signature.

Press Example to see a sample token decoded and verified with its secret, your-256-bit-secret.

The standard claims

Any claim can appear in a payload, but seven are defined by the JWT standard, RFC 7519:

ClaimNameMeaning
issIssuerWho created and signed the token
subSubjectWhom the token is about, usually a user id
audAudienceWho the token is meant for
expExpiration timeThe token must not be accepted after this time
nbfNot beforeThe token must not be accepted before this time
iatIssued atWhen the token was created
jtiJWT IDA unique id for the token, against replays

Tokens from OpenID Connect sign-ins add claims about the user, such as name, email and auth_time, and OAuth access tokens often carry scope. The payload's Breakdown explains these too.

Reading the times

The times in a JWT are Unix times: whole seconds since 1 January 1970, UTC. "exp": 1893456000 is 1 January 2030, 00:00:00 UTC. The decoder shows each time as a date in UTC and how long ago or from now it is. A time with 13 digits is almost always in milliseconds by mistake, and the decoder points that out.

Decoding is not verifying

Decoding only reads the token, and anyone can do it. Verifying proves that the token is genuine: the signature is worked out again from the header and the payload, and it must match. Change a single character of the token and it no longer does.

  • HMAC (HS256, HS384, HS512): the issuer and the server share one secret, so whoever can verify a token can also make one. Switch on The secret is Base64-encoded when the secret is stored that way.
  • Public-key algorithms (RS256, PS256, ES256, EdDSA and their variants): the issuer signs with its private key, and anyone can check the signature with the public key. Paste it as a PEM key (-----BEGIN PUBLIC KEY-----), a certificate, a JWK, or a whole JWK Set, the list that sign-in providers publish at an address such as /.well-known/jwks.json. From a JWK Set the decoder takes the key whose kid matches the token's header.

A verified signature is not the whole check. Your server must also refuse an expired token, test iss and aud, and decide the algorithm itself rather than trust the header. A token whose header says "alg": "none" is unsigned, and anyone could have written it.

Frequently asked questions

Is it safe to paste a token here?

The token and the key are used by this page in your browser, and nothing is sent or stored. Still, a token that hasn't expired works like a password until it does: keep live production tokens out of chats, tickets and screenshots. A public key is safe to share, but an HMAC secret is not: test with a development secret where you can.

Why does it say Invalid signature?

The signature doesn't match the key. Usually the secret or the key is the wrong one, such as a staging secret for a production token; the secret is Base64-encoded and the switch is off, or the other way round; or the token was changed or cut short when it was copied. An ES256 signature must be the 64-byte form JWTs use, not the DER form some libraries produce.

Why does the token say it has expired?

Its exp time has passed by your device's clock. Access tokens usually last minutes to an hour, and the app is expected to get a new one with a refresh token. If a fresh token already shows as expired, check the clock of the server that issued it.

Can a JWT be encrypted?

Yes: an encrypted token, a JWE, has five parts instead of three, and only the recipient's key can open it. This decoder recognises one and says so, but it can't read its contents.

What is the difference between a JWT and a session cookie?

A session cookie holds an id that the server looks up in its own storage. A JWT carries the data itself, signed, so any server with the key can check it without a lookup. The price is that a JWT can't easily be revoked before it expires, which is why access tokens are kept short-lived.