Skip to content
ENExplore Calculators

JWT Expiry Calculator

Pick a JWT exp claim: validity window with clock skew, when to refresh early, and how long a revoked token stays accepted.

About JWT Expiry Calculator

Verifiers usually accept a token for a little past its exp to tolerate clock drift, so the real validity window is the lifetime plus that leeway on each end. Refreshing at a fraction of the lifetime keeps a valid token in hand at all times instead of racing the expiry. The exp claim is the only revocation mechanism a stateless JWT has, so its value is literally the length of time a compromised or logged-out session keeps working.

Formulas

JWT Expiry

validity = (exp − iat) + clock skew leeway; refresh at (exp − iat) × (1 − refresh margin) so a renewal is in flight before the token dies.

exp
Expiry claim, seconds since the Unix epoch
iat
Issued-at claim
clock skew leeway
Extra tolerance verifiers allow for unsynchronised clocks

Revocation exposure

stale access after revocation = validity window, since a verifier that only checks the signature cannot learn the token was withdrawn.

nbf
Not-before claim — the same skew leeway applies at the start of the window

Worked example

With the default values below, JWT Expiry Calculator returns Refresh the Token At of 12m. Change any input above and every figure here is recalculated in your browser.

Inputs used

Token lifetime (exp − iat)accepts 0.25–1,440 minutes
15 minutes
Clock skew leeway allowed by verifiersaccepts 0–600 seconds
60 seconds
Refresh this far before expiryaccepts 0–90 %
20 %
Session length to coveraccepts 1–10,080 minutes
480 minutes
Requests per minute per clientaccepts 0.1–10,000 req/min
5 req/min

Results

Refresh the Token At
12m
Worst-Case Validity Window
16m
Refreshes per Session
39
Requests Served per Token
75
Maximum Stale Access After Revocation
960 seconds
Assessment
Balanced lifetime for a bearer token

Step by step

  1. 1Values used
  2. 2JWT Expiry
  3. 3Revocation exposure
  4. 4Refresh the Token At= 12
  5. 5Worst-Case Validity Window= 16
  6. 6Refreshes per Session= 39
  7. 7Requests Served per Token= 75
  8. 8Maximum Stale Access After Revocation= 960 seconds
  9. 9Assessment= Balanced lifetime for a bearer token

Assumptions and limits

  • The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How is JWT Expiry calculated?

validity = (exp − iat) + clock skew leeway; refresh at (exp − iat) × (1 − refresh margin) so a renewal is in flight before the token dies. Verifiers usually accept a token for a little past its exp to tolerate clock drift, so the real validity window is the lifetime plus that leeway on each end. Refreshing at a fraction of the lifetime keeps a valid token in hand at all times instead of racing the expiry.

Why does JWT Expiry matter?

The exp claim is the only revocation mechanism a stateless JWT has, so its value is literally the length of time a compromised or logged-out session keeps working.

What values do I need to enter?

This calculator takes 5 inputs: Token lifetime (exp − iat), Clock skew leeway allowed by verifiers, Refresh this far before expiry, Session length to cover, Requests per minute per client. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

How much clock skew leeway should a verifier allow?

Thirty to sixty seconds is typical and most libraries default to that range. Larger values silently extend every token's life, so if servers are NTP-synchronised there is little reason to go beyond a minute — and none to disable expiry checking to work around a drifting clock.

Can I revoke a JWT before it expires?

Not in the token itself. You need server-side state: a deny-list of jti values checked on each request, a token-version claim compared against the user record, or an introspection call. All three trade the statelessness that made JWTs attractive, which is why short lifetimes remain the usual answer.

JWT Expiry Calculator – Calculate Refresh the Token At