Understanding JWT exp, iat, and nbf Unix Timestamp Claims

Written by Raheel Ikram | Updated December 5, 2026 | Reading time: 5 minutes

An API returning 401 Unauthorized immediately after a user logs in usually points to a timestamp mistake inside the JSON Web Token. Sending 13-digit JavaScript milliseconds inside an exp field pushes the token thousands of years forward, while clock drift between auth servers triggers premature rejections.

The Three Standard JWT NumericDate Claims

According to IETF RFC 7519, a JWT NumericDate is always a JSON integer representing Unix seconds since January 1, 1970 UTC. Never put milliseconds or ISO strings inside these three registered claims:

ClaimFull NamePurpose in Authentication
expExpiration TimeReject the token at or after this exact Unix second.
iatIssued AtRecords when the token was signed; useful for calculating token age.
nbfNot BeforeReject the token before this Unix second arrives.

Example JWT Payload Using Unix Seconds

Here is a valid payload issued on December 5, 2026 with a 15-minute (900-second) lifespan:

{
  "sub": "user_4821",
  "iat": 1764892800,
  "nbf": 1764892800,
  "exp": 1764893700
}

How to Prevent Clock Skew Failures With Leeway

When one microservice issues a JWT and a second server verifies nbf or exp a fraction of a second later, a tiny NTP clock difference can reject a brand-new token. RFC 7519 recommends allowing a small leeway (typically 30 to 60 seconds) during verification.

// Node.js jsonwebtoken verification with 30s clock tolerance
jwt.verify(token, publicKey, {
  algorithms: ["RS256"],
  clockTolerance: 30
});
About the Author: Raheel Ikram

Creator of Timestamp Converter, writing practical guides on timekeeping, SQL schema design, and web utilities. Read full bio.