plain/devtools home

JWT expired error

The token's exp claim is a time that has already passed, so the server rejects it. Decode the token to read exp, then get a new token with your refresh flow or by signing in again.

Last reviewed 2026-11-04.

jwt-decodersampless sample · c copy
■ Header
■ Payload

This tool decodes only. It does not check the signature, so a decoded token is not proof the token is genuine.

never leaves your browser

Worked example

Click the "HS256 sample (expired)" sample in the decoder above. Its payload has "exp": 1516242622. The exp claim is a NumericDate: seconds since 1970-01-01T00:00:00Z. 1516242622 is 2018-01-18T02:30:22.000Z, years ago, so any check against the current time fails. The decoder shows the status as expired.

In the Node.js jsonwebtoken library the same condition throws TokenExpiredError: jwt expired.

Causes and fixes

  • The token really expired. Refresh it with your refresh token or sign in again.
  • Clock skew. If the server clock is ahead of the issuer, a fresh token looks expired. Sync time with NTP, or allow a small leeway (a few seconds) in the verifier.
  • Milliseconds instead of seconds. exp is in seconds, while Date.now() returns milliseconds. A check like exp < Date.now() compares a seconds value to a milliseconds value, so every token looks expired (1516242622 read as milliseconds is 1970-01-18). Compare with Date.now() / 1000.
  • A cached or stored old token. Check which token the client actually sends in the Authorization header.
  • A very short lifetime. Access tokens are often 5 to 60 minutes by design; handle the 401 by refreshing, not by lengthening the lifetime.

What decoding does and does not tell you

Decoding only reads the payload, which is base64url text, not encrypted. It does not check the signature, so use it to diagnose, never to trust a token. Verification happens on your server with the key.

Running this on a server

If you run your own auth API, you control token lifetimes and the server clock. A small VPS with NTP enabled is enough; the hosting guide compares options.

Frequently asked questions

Can I decode an expired JWT?

Yes. Expiry does not change the contents. You can still read the header and claims.

Is exp in seconds or milliseconds?

Seconds since the Unix epoch, per RFC 7519.

Is it safe to paste a token here?

Decoding runs in your browser and nothing is sent anywhere. Still treat live tokens like passwords.

Sources

Related

esc
↑↓ move↵ open? all shortcuts

Keyboard shortcuts

Cmd or Ctrl shortcuts always work.
Everywhere
Everywhere
Open the command palette
CtrlK
Open the palette (outside a text field)
/
Show these shortcuts
?
Toggle light and dark theme
t
Go home
gh
Go to all tools
gt
On a tool page
On a tool page
Run the main action
Ctrl↵
Copy the output
c
Load the next sample
s
Focus the input
i
Leave a text field
Esc
Previous or next tool
[]
In the palette
In the palette
Move the selection
↑↓
Open the selected item
↵
Close
Esc