Skip to content
FreeToolsKit.app

Network & Security guide

How to Decode a JWT and Read Its Expiry (Without Trusting It)

10 min read · Updated 20 November 2026 · Uses JWT Decoder & Inspector

Quick answer

A JWT (JSON Web Token) is three Base64URL-encoded parts joined by dots: a header, a payload of claims and a signature. The header and payload are only encoded, not encrypted, so any decoder can turn them back into readable JSON without a key (IETF: RFC 7519, JSON Web Token).

The expiry is the exp claim. It's a NumericDate: a count of seconds since 1 January 1970 00:00:00 UTC. Convert it to a UTC date, then compare that with the current time.

Decoding doesn't prove the token is genuine. Anyone can write any claims into a token. Only a signature check with the issuer's key, plus checks on the algorithm, issuer, audience and times, can show that a token is genuine. That check belongs in a JWT library on your server.

In FreeToolsKit's JWT Decoder & Inspector:

  1. Paste the token only, without the "Bearer " prefix, into JWT (compact header.payload.signature).
  2. Press Decode JWT.
  3. Read the Times list. It shows exp, nbf and iat as UTC dates and says whether each claimed time has passed by your device's clock.

The tool never checks the signature, and every result says Signature NOT verified.

JWT Decoder & InspectorFree to use · No account required · Decoded in your browserOpen JWT Decoder & Inspector

Before you paste a real token

A JWT used as an access token is usually a bearer token. RFC 6750 says "any party in possession of a bearer token (a 'bearer') can use it to get access to the associated resources". It adds that bearer tokens "need to be protected from disclosure in storage and in transport" (IETF: RFC 6750, Bearer Token Usage). Microsoft calls access tokens "sensitive credentials" (Microsoft Learn: Access tokens). GitHub's advice is "Treat your access tokens like passwords." (GitHub Docs: Managing your personal access tokens).

No standard or vendor we found says outright "don't paste tokens into online decoders". This is our advice, based on the sources above:

  • Prefer tokens that can't be used: decode an expired token, a token from a test environment, or one you can revoke straight afterwards.
  • Don't paste a live production token into a site you haven't checked: the token works for whoever holds it until it expires or is revoked.
  • Don't share a token in a bug report or chat: share the decoded payload instead, with personal details removed.

What we checked in this tool:

  • Code: decoding runs in your browser, using the site's own code. That code makes no network requests and doesn't use browser storage or cookies.
  • Browser test: pasting and decoding this guide's six test tokens sent no request containing the token. Afterwards, the token wasn't in the page address, cookies, local storage or session storage.
  • Your own copies: anything you copy stays on your clipboard, and the tool notes that clearing the page doesn't securely erase browser memory.

The test tokens used in this guide

To show what to check, we built six tokens with a script, using fictional claims. Each one has the issuer (iss) https://auth.example.com, the subject (sub) user-1234, the audience (aud) https://api.example.com and a custom scope claim. The signed ones use HS256 with a demo secret made for this test, so their signatures are real:

  • Token A, expired: issued at 09:00 UTC on 15 January 2026, expiring one hour later.
  • Token B, unexpired: issued at 08:00 UTC on 2 November 2026, expiring at 00:00 UTC on 1 January 2030. The long life keeps the example in the future. Real access tokens are usually much shorter: Microsoft's default is "a random value ranging between 60-90 minutes" (Microsoft Learn: Access tokens).
  • Token C, unsigned: token B's claims with the algorithm set to none and an empty signature.
  • Token D, edited: token B with scope changed from notes:read to notes:admin, keeping token B's signature.
  • Token E, not yet valid: a not-before time of 00:00 UTC on 1 January 2030.
  • Token F, milliseconds mistake: an exp of 1768471200000, which is token A's expiry written in milliseconds.

Read what's inside the token

Paste the token and press Decode JWT. For token A, the tool showed:

  • Status: "Decoded successfully — signature not verified."
  • Declared algorithm (alg): HS256 (unverified). Type (typ): JWT. Key ID (kid): demo-key-1.
  • Signature: "32 bytes present (not shown, not verified)". The size only shows that a signature is there, not that it's right.
  • Standard claims: Issuer (iss), Subject (sub) and Audience (aud) with the values above, each with a caveat such as "Not a verified identity". JWT ID (jti) showed Not present.

Below them, Header (JOSE) and Payload (claims) show the decoded JSON. Token A's payload held seven members:

  • iss: https://auth.example.com
  • sub: user-1234
  • aud: https://api.example.com
  • iat: 1768467600
  • nbf: 1768467600
  • exp: 1768471200
  • scope: notes:read

Because the payload is readable this easily, jwt.io notes that a signed token's contents, "though protected against tampering", are "readable by anyone". Don't put secrets in claims unless the token is encrypted (jwt.io: Introduction to JSON Web Tokens). An encrypted token (JWE) usually has five parts. This tool reports it and doesn't try to decrypt it.

If you paste the whole Authorization header value, the tool stops with: "Remove the "Bearer " prefix: paste only the token itself (the part after "Bearer ")."

Read the expiry: exp, nbf and iat

RFC 7519 defines the three time claims, all optional (IETF: RFC 7519, registered claims):

  • exp (expiration time): the time "on or after which the JWT MUST NOT be accepted for processing".
  • nbf (not before): the token must not be accepted before this time.
  • iat (issued at): when the token was issued, which "can be used to determine the age of the JWT".

Each is a NumericDate: "the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap seconds" (IETF: RFC 7519, terminology).

The tool's Times list showed these results, inspected at 16:11 UTC on 19 November 2026:

  • Token A: "Expiration (exp): Claimed expiration time has passed", with "Value: 1768471200 seconds → 2026-01-15 10:00:00 UTC (308 days 6 hours before the inspection time)". The nbf and iat lines both read 2026-01-15 09:00:00 UTC, so the token claimed a life of one hour.
  • Token B: "Expiration (exp): Claimed expiration time is in the future", at 2030-01-01 00:00:00 UTC.
  • Token E: "Not before (nbf): The token claims a future not-before time", at 2030-01-01 00:00:00 UTC.
  • Token F: the exp line read "+058010-08-15 16:00:00 UTC", a date in the year 58010. The tool added: "This value is unusually large. NumericDate is in seconds; if it was written in milliseconds by mistake, the date shown is wrong. It is NOT reinterpreted."

To convert a value by hand, use the Unix Timestamp Converter:

  1. Choose Timestamp → date.
  2. Select Seconds.
  3. Type the exp value, such as 1768471200, and press Convert.

For token A, it showed "Thursday, 15 January 2026, 10:00:00 UTC". The result matches the decoder because NumericDate and Unix time both count seconds since 1970.

Watch for the milliseconds mistake. A 13-digit exp is almost certainly milliseconds. It isn't harmless. We checked the six tokens with PyJWT 2.15.0, a JWT library for Python servers (details below). It accepted token F, because it read exp as a date in the year 58010. In practice, that token would never expire.

Why "has passed" may not match the server's decision

The tool compares each time with your device's clock at the moment you press Decode JWT. It doesn't update afterwards, and it says so: "These are interpretations of unverified claims, not a decision that the token is valid".

The server can decide differently, for three reasons:

  • Different clocks: the server's clock and yours may disagree.
  • Leeway: RFC 7519 lets implementers allow "some small leeway, usually no more than a few minutes, to account for clock skew" (IETF: RFC 7519, exp claim). Okta's .NET example uses two minutes, with the comment "a lower value is better; we recommend two minutes or less" (Okta Developer: Validate access tokens). No standard fixes one value.
  • Other checks: a token whose expiry is in the future can still fail on its signature, issuer or audience.

So a token shown as expired a minute ago may still be accepted briefly, and one shown as unexpired can still be rejected. Leeway only matters near the boundary. In our PyJWT check, five minutes of leeway didn't rescue token A, which had expired 308 days earlier.

Why decoding doesn't prove the token is genuine

Token D is the clearest test. The tool decoded it exactly like token B: the same Signature NOT verified notice, "Decoded successfully — signature not verified." and "32 bytes present (not shown, not verified)". The only difference was the claim we edited, scope notes:admin. Nothing in a decode reveals that the payload was changed after signing. Only checking the signature with the key does.

Token C, the unsigned one, got a status of "Decoded — unsecured token (alg: none), no signature." and a warning: "Unsecured JWT: "alg": "none" means the token carries no signature at all. Anyone can create or change it, so its claims must never be trusted."

That warning matters on servers too. RFC 8725, the IETF's JWT best practices, describes the attack: "The algorithm can be changed to "none" by an attacker, and some libraries would trust this value and "validate" the JWT without checking any signature" (IETF: RFC 8725, JWT Best Current Practices). OWASP's advice is "Make sure that "alg":"none" is not accepted by your JWT parser" (OWASP: JSON Web Token Cheat Sheet).

Libraries often offer a decode function next to a verify function. Auth0 warns: "Avoid using the decode() method to validate a token" (Auth0 Docs: Validate JSON Web Tokens).

Here's what happened when we verified all six tokens with PyJWT. It was told to accept only HS256, use the demo secret, expect our issuer and audience, and require exp, iat and nbf:

  • Token A: rejected, "Signature has expired".
  • Token B: accepted.
  • Token C: rejected, "The specified alg value is not allowed".
  • Token D: rejected, "Signature verification failed".
  • Token E: rejected, "The token is not yet valid (nbf)".
  • Token F: accepted, because of the milliseconds mistake described above.

The decoder displayed all six without complaint, apart from the warning on C and the note on F. That's the difference between reading a token and verifying it. This was one library on six test tokens, so it shows what to check, not how every library behaves.

Verify on the server, with a library

RFC 7519 sets out the validation steps. For a signed token, they include checking the signature, and "If any of the listed steps fail, then the JWT MUST be rejected". The RFC also says "it is an application decision which algorithms may be used" (IETF: RFC 7519, Validating a JWT).

In practice, configure your server's JWT library to:

  1. Allow only the algorithms you expect. RFC 8725 says libraries "MUST enable the caller to specify a supported set of algorithms" (IETF: RFC 8725, algorithm verification). Never let the token's own alg decide.
  2. Check the signature with the issuer's key, taken from your configuration. Don't blindly follow a key URL named in the token's header (RFC 8725, section 3.10).
  3. Check exp and nbf, with at most a small leeway.
  4. Check iss and aud against the values you expect. OWASP notes that many libraries have built-in support for validating nbf, exp, iss and aud (OWASP: JSON Web Token Cheat Sheet).
  5. Reject the token if any check fails.

Who should decode at all? Microsoft says client apps "should treat them as opaque strings", and that developers can decode them "for validation and debugging purposes only" (Microsoft Learn: Access tokens). RFC 9068 is stricter: "The client MUST NOT inspect the content of the access token", because the format can change at any time (IETF: RFC 9068, JWT profile for access tokens). Decode to debug. Don't build app logic on reading an access token in the client.

Before you rely on what you decoded

  1. Safe token: you decoded an expired or test token, or one you can revoke.
  2. Warnings read: you checked any warning first, especially an unsecured alg: none token.
  3. Times converted: exp, nbf and iat are 10-digit seconds that convert to sensible UTC dates, not 13-digit milliseconds.
  4. Clock and leeway allowed for: a token near its expiry may be accepted or rejected depending on the server's clock and leeway.
  5. Verification on the server: your server's JWT library pins the algorithm, checks the signature with the issuer's key, and checks exp, nbf, iss and aud. A decoded claim is only what the token says about itself.