Saved

Press the star next to a tool's name to save it.

All my tools

JWT Decoder

Paste a token into this JWT decoder to read its header and payload, see exp, nbf and iat as dates, and check if it has expired. The signature is not verified, and nothing leaves your browser.

Paste the whole token. A leading "Bearer" is ignored. The signature is not verified.

Everything is worked out in your browser. Nothing you paste is sent anywhere.

Token status

–

Paste a token and press Decode.

A JWT decoder turns the long dotted string inside a login token into readable JSON. Paste a JSON Web Token, press Decode, and you see the header, the payload, the expiry time in your own time zone and whether the token has already expired. Everything happens in your browser, so the token never travels to a server.

Developers reach for a JWT decoder when an API answers 401, when a login does not stick, or when they simply want to know which claims an identity provider put in a token. The decoder shows the facts in the token. It does not prove the token is genuine, and the page says so next to every result.

What is inside a JSON Web Token

A signed JWT in its compact form is three pieces joined by periods: the encoded header, the encoded payload and the encoded signature [2]. The header and payload are JSON objects that have been written in base64url, which is base64 with a URL-safe alphabet and no trailing equals signs [2]. The payload is a set of claims, each a name and a value [1]. Because base64url is only an encoding, not encryption, anyone who holds the token can read the claims. That is why this tool can show them without any key.

How to use the JWT decoder

  1. Copy the token from your app, a browser tool or an HTTP header. A leading word "Bearer" and line breaks are removed for you.
  2. Paste it into the box and press Decode.
  3. Read the status line at the top: expired, not yet valid, valid for a stated time, or no expiry.
  4. Check the table for the algorithm, key ID, issuer, subject, audience and the three time claims.
  5. Copy the formatted header or payload if you need to share the JSON.

Time claims: exp, nbf and iat

Three claims carry times. Each one is a NumericDate, a JSON number counting the seconds since 1 January 1970 at 00:00 UTC [1]. The "exp" claim is the moment the token stops being acceptable: the current time must be before it [1]. The "nbf" claim is the earliest moment it may be accepted, so the current time must be at or after it [1]. The "iat" claim records when the token was issued, which lets you work out its age [1].

The decoder shows each of these as a local date and time in your time zone and as an ISO 8601 time in UTC. The status line compares "exp" and "nbf" with your computer clock. If your clock is wrong by several minutes, the status can be wrong too, so check the clock when a fresh token looks expired.

ClaimMeaningChecked by the decoder
expExpiration timeExpired when the current time is at or after it
nbfNot beforeNot yet valid when the current time is earlier
iatIssued atShown as a date only
iss, sub, audIssuer, subject, audienceShown as text

Why the signature is not verified

The third piece of a token is the signature. Checking it needs the secret or the public key that the issuer used, and it needs the application to decide which algorithms it accepts [2]. A browser tool that pasted in your key would be a risk, so this decoder never asks for one. It shows the size of the signature and stops there.

That has a practical meaning. A decoded token is not a trusted token. Anyone can write a payload that says "admin": true, encode it and attach a made-up signature. Only your server, using the right key, can say whether the token is real. An unsecured token that uses the algorithm "none" has no signature at all [1], so its claims are not protected from change.

Keep live tokens private

Treat a JWT like a password while it is valid. Whoever holds it can usually act as you until it expires. This decoder runs in your browser and sends nothing, but good habits still apply: prefer expired or test tokens when you paste into any tool, never post a live token in a chat or a bug report, and rotate a token if you shared it by mistake.

  • Remove the signature part before sharing a token for debugging; the header and payload are usually enough.
  • Do not put secrets or personal data in claims. Anyone who gets the token can read them.
  • Use short expiry times for access tokens so a leaked token stops working soon.

Worked example

The sample token that starts with eyJhbGciOiJIUzI1NiIs decodes to the header {"alg":"HS256","typ":"JWT"} and the payload {"sub":"1234567890","name":"John Doe","iat":1516239022}. The "iat" value is 18 January 2018 at 01:30:22 UTC. This token has no "exp" claim, so the decoder reports that it has no expiry. The signature is 32 bytes long, which matches the output size of the HMAC-SHA-256 algorithm named in the header.

Common problems when decoding a JWT

  • "Not three parts." A compact JWT has exactly two periods. Encrypted tokens have five parts and cannot be read this way.
  • "Header is not valid." The first part must decode to a JSON object. A cut-off paste is the usual cause.
  • A time that looks wrong. The values are in seconds, not milliseconds. A 13-digit number is a milliseconds value put in by mistake.
  • An expired token you just got. Check your computer clock and the time zone of the server that issued it.

What next

Use this often? Add JWT Decoder to your Home screen.

Frequently asked questions

What does a JWT decoder do?

A JWT decoder reads the first two parts of a JSON Web Token, converts them from base64url to JSON and shows the claims. It also turns exp, nbf and iat into dates and says whether the token has expired.

Does this JWT decoder verify the signature?

No. Verifying needs the issuer's secret or public key. This tool only shows what the token claims, so a decoded token is not proof that the token is genuine.

Is it safe to paste a token into this tool?

The decoding runs in your browser and nothing is sent to a server. Even so, treat a live token like a password and prefer expired or test tokens.

Why does my token say it has expired?

The exp claim is a time in seconds since 1970 in UTC. The tool compares it with your computer clock, so a wrong clock can give a wrong status.

Can I decode an encrypted JWT?

No. Encrypted tokens have five parts and their content is not readable without the key. This tool reads signed tokens with three parts.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Developer Tools