JWT Decoder

Published Updated

Paste a JSON Web Token to read its header and payload as formatted JSON, with exp and iat shown as dates and a Not Expired, Expired or No Expiration badge. The signature gets a format check and is never verified.

Reading a token is not verifying it

Anyone holding a JWT can read it. The header and payload are JSON encoded with base64url, the URL-safe alphabet without trailing = signs (RFC 7515, section 2). That is an encoding, not encryption: a signed token gives integrity protection only. This page reverses the encoding and prints the JSON. It checks that the signature part is valid base64url, but it never verifies the signature, which needs the issuer's key.

The token must split at its dots into exactly three parts, header.payload.signature. Five parts mean an encrypted JWE (RFC 7516, section 9 counts the dots to tell them apart), and the page stops with "A JWT must have three dot-separated parts".

What the badge and the dates mean

RFC 7519 defines exp, nbf and iat as NumericDate: a JSON number of seconds since 1970-01-01T00:00:00Z.

In the payloadOn the pageWhat it tells you
exp later than nowNot ExpiredOnly that the clock has not reached exp
exp equal to now or earlierExpiredRFC 7519: not to be accepted on or after exp
No exp, or exp as a stringNo ExpirationA quoted "1793470280" is not a NumericDate
iat presentIssued at cardShown, never judged
nbf presentNothingNot read at all

Dates appear as YYYY-MM-DD HH:MM:SS in local time. The sample token in RFC 7519 has exp 1300819380, 2011-03-22 18:43:00 UTC, so it decodes as Expired.

One token, three time zones

We rendered the decoder's own component in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app), with the browser clock fixed at 12:00:00 UTC on 16 November 2026 and the time zone set to UTC, America/Los_Angeles and Asia/Tokyo in turn. The tokens were made and signed for the test with Node's crypto module; no real token was used. All four engines showed the same text in every row below.

First, one token with exp at 13:00:00 UTC and iat at 11:00:00 UTC. The cards follow the device's time zone and do not name it:

Time zoneExpiration time (exp) cardIssued at (iat) card
UTC2026-11-16 13:00:002026-11-16 11:00:00
America/Los_Angeles2026-11-16 05:00:002026-11-16 03:00:00
Asia/Tokyo2026-11-16 22:00:002026-11-16 20:00:00

Then the same clock with different exp values, cards read in the UTC run:

exp in the payloadBadgeExpiration card
1794834000, an hour after the clockNot Expired2026-11-16 13:00:00
1794830400, the same second as the clockExpired2026-11-16 12:00:00
1794830399, one second before the clockExpired2026-11-16 11:59:59
1794834000.75Not Expired2026-11-16 13:00:00 (the fraction is dropped)
"1794834000", a stringNo ExpirationNot set
1794834000000, milliseconds by mistakeNot Expired58846-01-09 16:00:00
10000000000000Not ExpiredNaN-NaN-NaN NaN:NaN:NaN
0Expired1970-01-01 00:00:00, or 1969-12-31 16:00:00 in the Los Angeles run
nullNo ExpirationNot set

RFC 7519, section 4.1.4 says the current time MUST be before exp, so the row where exp equals the current second shows Expired; the same section allows implementers a small leeway for clock skew, which the page does not add. An nbf one day ahead and an iat one day ahead changed nothing: the badge still read Not Expired and iat was shown as an ordinary date.

What the signature line checks and what slips through

The line under the badge looks only at the characters and the length of the signature part; no key is involved, so it cannot tell a genuine signature from a forged one. Results from the same run in Chrome 156, Chromium 153, Firefox 155 and the WebKit build, the same in each:

TokenWhat the page showed
HS256, signature of 43 charactersSignature format: valid base64url, 32 bytes once decoded.
HS512 or ES256, signature of 86 charactersSignature format: valid base64url, 64 bytes once decoded.
RS256 with a 2048-bit key, signature of 342 charactersSignature format: valid base64url, 256 bytes once decoded.
alg none, empty signatureSignature format: empty, as alg none calls for. This token is unsigned, so anyone can edit it.
alg none with a signatureSignature format: alg none calls for an empty signature, but this token has one.
alg None with a capital N, empty signatureRead as a signed algorithm: Signature format: empty, although the header says alg None. A signed token needs a signature.
Signature ending in =, or using + and /Signature format: not valid base64url. It has characters other than A-Z, a-z, 0-9, - and _.
Signature of 45 charactersSignature format: not valid base64url. Its length can't come from whole bytes.
Header and payload padded with =, or payload in standard Base64 with + and /Decoded normally, with no remark
A line break inside the payloadOne test token gave Couldn't decode this token; a second token, of a different length, decoded normally
Bearer prefix, or the token in quotation marksCouldn't decode this token. Please check that it's a valid, unmodified JWT.
Spaces or line breaks before and after the tokenDecoded normally, since the ends are trimmed
Payload [1,2,3], "hello" or 42Decoded, badge No Expiration, no warning
exp written twice in the payloadOnly the second value shown, and used for the badge
Five parts shaped like an encrypted JWE, or two partsA JWT must have three dot-separated parts (Header.Payload.Signature).

RFC 7515, section 2 defines base64url as the URL-safe alphabet of RFC 4648, section 5, with - and _ in place of + and /, without trailing = signs and without line breaks or whitespace, so the decoder is more lenient than the standard with the header and payload and stricter with the signature. For a repeated claim name, RFC 7519, section 4 lets a parser reject the token or keep the lexically last value; this page keeps the last one without mentioning the first. A payload with José Müller and an emoji decoded correctly, while bytes that are not valid UTF-8 gave Couldn't decode this token. Tokens were typed into the box and decoded with the Decode button; the next section compares pasting.

Line breaks inside a token, and what a paste decodes

A token copied from an email, a log or a wrapped terminal line can pick up a line break or a space. We generated tokens whose payload part is 44, 46 or 47 characters long, put whitespace in the middle of that part, typed each token into the box and pressed Decode. Measured in Google Chrome 157, Firefox 155 and the WebKit build, the three gave the same result in every cell:

Payload partNo whitespaceOne line break, space or tabTwo line breaks in a row
44 characters, a multiple of 4DecodedCouldn't decode this tokenCouldn't decode this token
46 characters, 2 more than a multiple of 4DecodedCouldn't decode this tokenDecoded
47 characters, 3 more than a multiple of 4DecodedDecodedCouldn't decode this token

The page adds = signs until the part, whitespace included, is a multiple of 4 characters long, then hands it to the browser's atob, which throws when the text is not valid base64. atob follows the WHATWG forgiving-base64 decode: it first removes ASCII whitespace (tab, line feed, form feed, carriage return and space) and then fails if = signs are left that the shorter text has no room for. With one extra character a 47-character part needs no = sign, and with two extra characters a 46-character part needs none, so those two cells decode and the others do not. The same line break in the 36-character header gave Couldn't decode this token. Inside the signature it left the header and payload readable and turned the signature line to not valid base64url.

Pasting decodes only the pasted text: the page reads it from the paste event's clipboardData, not from the box. A clean token pasted into an empty box gave the same header, payload, badge and signature line as the Decode button. With Bearer and a space already typed, a pasted token still showed its cards while the box read Bearer eyJ..., and pressing Decode on that box then gave Couldn't decode this token. These pastes were simulated with a paste event carrying the token, in the same three browsers.

Decoding a token in three moves

  1. Step 1

    Paste the token

    Pasting decodes at once; typed or edited text needs the Decode button. Leave out any Bearer prefix.

  2. Step 2

    Read the badge and dates

    The badge looks only at exp. The date cards show exp and iat in your local time, or Not set.

  3. Step 3

    Copy what you need

    Header and payload each have a Copy button for the indented JSON. The signature stays raw text.

Tokens that will not decode

  • A Bearer prefix. An Authorization header reads Bearer, a space, then the token (RFC 6750, section 2.1). Copy only what follows the space.
  • Five parts. An encrypted token can only be opened with the recipient's key.
  • A payload of null. RFC 7519 requires a JSON object. A payload of null stops the page with a raw browser message in place of the usual wording: Cannot read properties of null (reading 'exp') in Chrome 156 and Chromium 153, can't access property "exp", payload is null in Firefox 155, and null is not an object (evaluating 'payload.exp') in the WebKit build. An array, a string or a number is not refused: it decodes and shows No Expiration with no warning.

Treat a live token like a password

Decoding uses atob and JSON.parse on the page, and no request carries the token. It is still a key: RFC 6750 defines a bearer token as one that any holder can use, so a live token pasted into a chat lets the reader act as you until exp passes.

RFC 8725 warns that attackers can switch alg to none and that some libraries trusted it, so verify signatures in your own code. For signed test tokens, try JWT Generator; for other epoch values, Unix Timestamp Converter.

JWT decoding questions

Does decoding a JWT prove it is genuine?

No. Anyone can edit the payload and encode it again. Only a signature check with the issuer's secret or public key shows that nothing changed, and this page never runs one, so Not Expired means just that exp is still ahead.

Can I read a JWT without the secret key?

Yes, for the usual signed kind, because the header and payload are only encoded. A key is needed to check the signature, or to open a five-part encrypted token, which this page turns away.

Why does it say Couldn't decode this token?

The first or second part did not turn into JSON. Usual causes: a Bearer prefix left in front, a token cut short or broken by a line break while copying, or an opaque access token that is not a JWT at all.

What time zone are the exp and iat dates in?

Your device's. The token stores seconds counted from 1 January 1970 UTC, and the page converts them with your local clock settings without printing the zone.

Does it check nbf, aud or iss?

No. Only exp feeds the badge. A token whose nbf is a day ahead still shows Not Expired, and aud and iss are shown in the payload but compared with nothing.

What does alg none in the header mean?

It marks an Unsecured JWT, whose signature part is empty. The page decodes it, notes the missing signature and may still show Not Expired. A server should refuse one from a client, since without a signature any edited payload passes.

Why does the expiration date show the year 58846?

The page reads exp as seconds since 1970, as RFC 7519 defines it. In our test a token whose exp was written in milliseconds, 1794834000000, showed 58846-01-09 16:00:00 in a UTC browser with the badge Not Expired. The same moment in seconds, 1794834000, showed 2026-11-16 13:00:00. The fix belongs in the code that creates the token.

Does a token count as expired in the same second as its exp?

Yes. The badge reads Expired from the second of exp onward. With the browser clock fixed at the same second as exp, all four engines we tested showed Expired, as they did for a token whose exp was one second earlier, while an exp an hour ahead showed Not Expired. RFC 7519 says the current time must be before exp; it also allows a small leeway for clock skew, which this page does not add.

Does the decoder accept padded or standard Base64 tokens?

For the header and payload, yes: test parts padded with = and a payload using + and / decoded normally, although RFC 7515 defines base64url without = signs and with - and _ in place of + and /. The signature line is stricter and reports not valid base64url for a signature with =, + or /.

What happens if the same claim appears twice?

The page keeps the last one. A test payload with exp written twice, first in the past and then an hour ahead, showed only the second value and the badge Not Expired. RFC 7519 lets a parser either reject such a token or keep the lexically last value, so another library may refuse it.

Why won't a token copied from an email or a log decode?

Look for a line break or space inside it. Whether such a token still decodes depends on the length of the part that holds it: one line break decoded a 47-character payload part but not a 44- or 46-character one, the same in Chrome 157, Firefox 155 and the WebKit build. Remove every space and line break inside the token and decode again.

Does pasting decode everything in the box?

No, only the text being pasted. With Bearer and a space already in the box, a pasted token still showed its header and payload while the box kept Bearer in front, and pressing Decode afterwards gave Couldn't decode this token. Clear the box before pasting, or delete the prefix and press Decode.

Why does the signature line say not valid base64url after copying a token?

A line break or space has landed inside the signature part. The header and payload still decode, but the signature check accepts only A-Z, a-z, 0-9, - and _, so a line break in the middle of a 43-character signature turned that line to not valid base64url.

Related Tools