Skip to content
⚠ TESTING ENVIRONMENT You are viewing a testing copy of Tolioo. Changes here do not affect the live website.

JWT Expiry Inspector

Paste a JSON Web Token to see if it is expired, when it expires and how long it lives. Get a live countdown, exp, iat and nbf dates in your time zone, and security warnings. Fast, free and no signup.

  • 100% free
  • No API, no upload
  • Runs in your browser

Your JWT

0 characters
Verify the signature (optional)

Enter the secret for HS256, HS384 or HS512, or the public key (PEM or JWK) for RS, PS and ES algorithms. The key stays in your browser.

ADVERTISEMENT
Demo Ad 728 x 90

How to check JWT expiration

1Paste the token

Paste a JWT from a header, cookie, log or API response.

2Read the status

See if it is valid, expired or not yet valid, with a live countdown.

3Review the checks

Check the dates in your time zone and fix any security warnings.

JWT EXPIRATION GUIDE

JWT Expiry Inspector – Check JWT Expiration, exp, iat and nbf Online

This free JWT expiry inspector tells you in one click whether a JSON Web Token is expired, when it expires and how long it lives. Paste a token and the tool decodes the payload, reads the exp, nbf and iat claims, converts them to readable dates in UTC and in your own time zone, and shows a live countdown to expiry. It also runs security checks on the token, such as a missing expiry, an unsigned alg none token, a very long lifetime, an exp value in milliseconds, or keys referenced from the header. You can even verify the signature in your browser with your own secret or public key. Everything works locally, without any third-party API, so your token is never uploaded.

JWT Expiration Checker

See at a glance if the token is valid, expired or not yet valid, with the exact expiry date, the time left and a live countdown that updates every second.

exp, iat and nbf in Your Time Zone

Convert every time claim to UTC, to your local time or to any city, see how old the token is, and test a clock skew tolerance to understand borderline cases.

Security Checks and Signature Test

Spot risky tokens early and verify HS256, RS256, PS256 and ES256 signatures locally, with protection against the classic algorithm confusion mistake.

What Is the exp Claim in a JWT?

A JSON Web Token (JWT) carries a set of claims, which are statements about a user or a session. The exp claim is the expiration time. It holds a number called a NumericDate: the number of seconds since 1 January 1970 at 00:00:00 UTC, which is the same Unix time that databases and programming languages use. The rule is simple. A server must reject the token when the current time is on or after exp.

Expiry is one of the most important protections of a JWT. A token is usually valid on its own: the server does not look it up in a database, so it cannot easily cancel a token before it expires. A short lifetime limits the harm when a token is stolen or leaked.

How to Check JWT Expiration in 3 Steps

  1. Copy the token: Take it from the Authorization header after the word Bearer, from a cookie, from local storage, from a log line or from an API response.
  2. Paste it into the inspector: The status appears instantly. The banner says whether the token is valid, expired or not yet valid, and the countdown shows how long is left or how long ago it expired.
  3. Read the details: Check the exp, nbf and iat dates, the lifetime and the security findings. Set your time zone and a clock skew tolerance if you need to compare with a server.

JWT Time Claims: exp, nbf and iat

The three registered time claims of a JWT
ClaimNameMeaningValidation rule
expExpiration timeThe moment after which the token is no longer validReject if now is on or after exp
nbfNot beforeThe moment before which the token must not be acceptedReject if now is before nbf
iatIssued atThe moment the token was createdUsed to work out the age of the token

All three are NumericDate values in seconds, not milliseconds. This is the most common source of mistakes: JavaScript Date.now() returns milliseconds, so it must be divided by 1000 before it is placed in a token.

{
  "sub": "1234567890",
  "iat": 1700000000,
  "exp": 1700003600
}

In this example the token was issued on 14 November 2023 at 22:13:20 UTC and expires exactly one hour later, at 23:13:20 UTC, so its lifetime is 3,600 seconds. You can convert any of these numbers to dates yourself with the Unix Timestamp Converter.

How JWT Expiry Validation Works

A correct validator performs these checks in order: it verifies the signature with the right key and algorithm, then compares the current time with the time claims. In simple terms, the token is accepted only when nbf is less than or equal to now and now is less than exp. Many libraries also let you set a leeway.

Leeway, also called clock skew tolerance, is a small number of seconds added to the comparison so that tokens are not rejected because two servers disagree by a moment. A typical value is 30 to 60 seconds. Use it only to absorb small clock differences. A large leeway quietly makes all your tokens live longer than you intended. This tool lets you test a tolerance and shows how it changes the status.

How to Fix “JWT Expired” Errors

When a request fails with a message such as jwt expired, the token has passed its exp time. These are the usual causes and the way to fix each one:

  • The token really expired: Request a new access token with your refresh token, or ask the user to sign in again. Build the refresh into your API client so that it happens before the old token runs out.
  • The clock is wrong: If a server or a device clock is off, tokens look expired or not yet valid. Synchronise clocks with NTP and add a small leeway.
  • Seconds and milliseconds are mixed up: An exp value that is 1000 times too large is a date in the distant future. A value that was divided twice is a date in 1970. Check the digit count: 10 digits means seconds and 13 digits means milliseconds.
  • Time zones are confused: A JWT time is always UTC. Compare it with UTC time, not with local clock time.
  • An old token is cached: Make sure your app, proxy or test tool is not sending a stored token after you refreshed it.
  • The lifetime is too short: If users are signed out constantly, use a longer-lived refresh token to get new access tokens instead of making access tokens last for days.
How common libraries report an expired token
Language and libraryError you will see
Node.js (jsonwebtoken)TokenExpiredError: jwt expired
Python (PyJWT)ExpiredSignatureError: Signature has expired
Java (jjwt)ExpiredJwtException
.NET (Microsoft.IdentityModel)SecurityTokenExpiredException
Go (golang-jwt)token is expired (ErrTokenExpired)
PHP (firebase/php-jwt)ExpiredException: Expired token

Recommended JWT Lifetimes

The right lifetime depends on how sensitive the action is and how easily you can revoke access. These are common practices, not fixed standards:

Typical lifetimes for different kinds of tokens
Token typeCommon lifetimeNotes
Access token5 to 15 minutes, up to 1 hourSent with every API request, so keep it short
ID tokenAbout 1 hourProves who signed in, not meant for calling APIs
Refresh tokenDays to weeksStore it carefully and rotate it on every use
Email verification or password reset15 minutes to 1 hourSingle purpose, ideally single use

The inspector warns you when a token lives for more than 24 hours and when it lives for more than 30 days, so you can spot tokens that are likely to be too generous.

How to Check JWT Expiry in Code

In your own code you should let a JWT library verify the signature and the expiry together. This is how it looks in popular languages:

// JavaScript: read the exp claim (does NOT verify the signature)
function isExpired(token) {
  const part = token.split(".")[1].replace(/-/g, "+").replace(/_/g, "/");
  const payload = JSON.parse(atob(part));
  return Date.now() / 1000 >= payload.exp;
}
# Python with PyJWT: verifies the signature and exp, with 30 seconds of leeway
import jwt

try:
    data = jwt.decode(token, key, algorithms=["HS256"], leeway=30)
except jwt.ExpiredSignatureError:
    print("Token expired")
// PHP with firebase/php-jwt
use Firebase\JWT\JWT;
use Firebase\JWT\Key;
use Firebase\JWT\ExpiredException;

JWT::$leeway = 30;

try {
    $data = JWT::decode($token, new Key($key, 'HS256'));
} catch (ExpiredException $e) {
    echo 'Token expired';
}

The first example is only suitable for showing a countdown in a user interface. Never use it to decide whether a request is allowed. Authorization decisions must be made on the server after the signature is verified.

JWT Security Checklist

  • Always verify the signature on the server: A decoded token proves nothing. Anyone can create a token with any claims.
  • Pin the allowed algorithms: Accept only the algorithm you use, and reject alg none. Never let the token header choose the algorithm.
  • Do not use a public key as an HMAC secret: This mix-up, known as algorithm confusion, lets attackers forge tokens. The signature check of this tool refuses it.
  • Validate exp, nbf, iss and aud: Check the expiry, the start time, the issuer and that the audience is your own service.
  • Do not trust keys named in the header: Fields such as jku, x5u and jwk can point to attacker-controlled keys. Load keys only from your own trusted configuration.
  • Keep lifetimes short: Use short access tokens with refresh token rotation, and plan how you will revoke access.
  • Do not put secrets in the payload: A JWT payload is only encoded, not encrypted, and anyone who holds the token can read it.
  • Store and send tokens safely: Use HTTPS only, and protect stored tokens against theft by scripts, for example with HttpOnly and Secure cookies.

Decoding vs Verifying a JWT

A JWT has three parts separated by dots: a header, a payload and a signature. The first two are only Base64url-encoded JSON, which anyone can decode. The signature is what protects the token. It is created with a secret or a private key, and it proves that the header and the payload were not changed. So the dates that you see in a decoded token are only reliable after the signature has been verified. The optional signature check in this tool supports HS256, HS384, HS512, RS256, RS384, RS512, PS256, PS384, PS512, ES256, ES384 and ES512, using the browser's built-in cryptography.

Privacy: Is It Safe to Paste a JWT Online?

A valid JWT works like a temporary password. Anyone who has it can use it until it expires, so be careful where you paste it. This inspector does all of its work inside your browser, and it does not call an API, store the token or send it anywhere. For extra safety, use test tokens or expired tokens when you can, never paste long-lived production tokens or signing secrets into a website that you do not trust, and rotate or revoke a token if you believe that it was exposed. For a full view of every claim in a token you can also use the JWT Decoder.

Related Tools for Developers

Use the Unix Timestamp Converter to turn exp, iat and nbf values into dates, the Base64 Encode and Decode tool to read the parts of a token by hand, the JSON Formatter to format the payload, the Hash Generator to create checksums, and the UUID Generator to create unique values for the jti claim.

Free JWT Expiration Checker Online, No Signup

Our JWT expiry inspector is free, fast and works on desktop, tablet and mobile. There is no account, nothing to install and no limit on the number of tokens you check. The token is processed in your browser and never leaves your device. Use it to debug expired token errors, to confirm token lifetimes, to compare the dates with your server clock and to review the security of your tokens.

ADVERTISEMENT
Demo Ad In-article
COMMON QUESTIONS

Frequently Asked Questions About JWT Expiration

Find answers to common questions about the exp claim, expired tokens, clock skew and keeping your tokens safe.

How do I check if a JWT is expired?

Paste the token into the JWT Expiry Inspector. The tool decodes the payload, reads the exp claim, which is a Unix timestamp in seconds, and compares it with the current time. It then shows whether the token is valid, expired or not yet valid, the exact expiry date in UTC and in your time zone, and a live countdown. If the token has no exp claim, the tool tells you that it never expires on its own.

What is the exp claim in a JWT?

The exp claim is the expiration time of the token. Its value is a NumericDate: the number of seconds since 1 January 1970 at 00:00:00 UTC. The token must not be accepted on or after that moment. For example, exp 1700003600 means 14 November 2023 at 23:13:20 UTC. The related claims nbf (not before) and iat (issued at) use the same format.

Does this tool verify the JWT signature?

Decoding a token only reads it. It does not prove that the token is genuine, because anyone can create a token with any claims. This tool can optionally verify the signature in your browser if you enter the secret for HS256, HS384 or HS512, or the public key for RS, PS and ES algorithms. Without a key, treat the dates as unverified information. Your server must always verify the signature itself.

Why does my JWT show as expired when it should still be valid?

The most common causes are a clock that is wrong on the server or the client, an exp value written in milliseconds instead of seconds, confusion between time zones, an old token that was cached, or a refresh that failed. Check the expiry date shown in UTC, compare it with the real current UTC time and look for the milliseconds warning in the findings list. A small clock skew tolerance, also called leeway, can hide minor clock differences.

What is clock skew or leeway in JWT validation?

Clock skew is the difference between the clocks of the system that issued the token and the system that checks it. Leeway is a small number of seconds, often 30 to 60, that the validator adds to exp and nbf so that tokens are not rejected because of tiny clock differences. You can set the tolerance in the settings and see how the status changes. Keep leeway small, because it extends the life of every token.

How long should a JWT be valid?

There is no single rule, but common practice is to keep access tokens short, from about 5 to 15 minutes up to one hour, and to use a longer-lived refresh token, valid for days or weeks and ideally rotated, to get new access tokens. Short lifetimes limit the damage if a token is stolen, because a JWT usually cannot be revoked before it expires. The inspector warns you when a token lives for more than a day.

Is it safe to paste my JWT into this tool?

The decoding, the countdown and the optional signature check all run in your browser. The token is not uploaded, saved or sent to any API. Even so, a valid token works like a password until it expires, so avoid pasting live production tokens into any website. Prefer test tokens or expired tokens, and if you think a real token was exposed, revoke it or rotate the signing key.

ADVERTISEMENT
Demo Ad 970 x 250

All Tools, One Place

Merge, split, compress and convert files in seconds. Explore powerful free tools for all your everyday needs.

Explore All Tools →