JWT Expiration & Epoch Timestamp Calculator
Decode JWT headers and payloads offline with live ticking UTC and local expiration countdowns, or generate ready-to-copy iat and exp Unix epoch claim pairs.
Understanding JWT NumericDate Claims & Unix Epoch Seconds
JSON Web Tokens (JWTs, defined in RFC 7519) consist of three dot-separated Base64URL-encoded segments: Header.Payload.Signature. Because the Header and Payload are merely Base64URL-encoded JSON—not encrypted—any client or browser can inspect their claims locally without possessing the signing secret or contacting an authorization server. DevPayload strictly decodes tokens in memory and never transmits them over the network.
Three registered temporal claims control a token's lifecycle: exp (Expiration Time), iat (Issued At), and nbf (Not Before). Crucially, RFC 7519 mandates that all JWT NumericDate values be expressed in Unix Epoch seconds (UTC), NOT JavaScript milliseconds. Passing Date.now() directly instead of Math.floor(Date.now() / 1000) is one of the most frequent authentication bugs, inadvertently creating tokens that appear valid for tens of thousands of years.
In production systems, short-lived access tokens (15 minutes to 1 hour) paired with rotating refresh tokens limit blast radius if a token is intercepted. Always compare exp against UTC epoch seconds on the backend and allow a small clock-skew leeway (typically 30–60 seconds) across distributed microservices.
Unix Epoch Seconds vs. Milliseconds (RFC 7519)
JWT temporal claims always use UTC integer seconds since 1970-01-01T00:00:00Z. Converting between JavaScript Date timestamps and JWT claims requires multiplying or dividing by 1,000.
iat = floor(Date.now() / 1000) // 10-digit UTC Unix epoch seconds
exp = iat + TTL_seconds // e.g., +3600 for 1 hour, +86400 for 24h
remaining_seconds = exp - floor(Date.now() / 1000)
UTC_ISO_8601 = new Date(exp * 1000).toISOString() Code Equivalents (Python & JavaScript / Node.js)
import time
from datetime import datetime, timezone
now_epoch = int(time.time()) # Unix epoch SECONDS (UTC)
exp_epoch = now_epoch + (15 * 60) # +15 minutes
payload = {
"sub": "user_12345",
"iat": now_epoch,
"exp": exp_epoch,
}
print("iat UTC:", datetime.fromtimestamp(now_epoch, tz=timezone.utc).isoformat())
print("exp UTC:", datetime.fromtimestamp(exp_epoch, tz=timezone.utc).isoformat())
print("Seconds remaining:", exp_epoch - int(time.time())) function decodeJwtExpiry(token) {
const [, payloadB64Url] = token.split('.');
const json = Buffer.from(payloadB64Url, 'base64url').toString('utf8');
const payload = JSON.parse(json);
const nowSec = Math.floor(Date.now() / 1000); // Seconds, not ms!
const remainingSec = payload.exp - nowSec;
return {
exp: payload.exp,
expUtc: new Date(payload.exp * 1000).toISOString(),
isExpired: remainingSec <= 0,
remainingSec,
};
} Frequently Asked Questions
Is it safe to paste a production JWT into DevPayload? +
DevPayload decodes your JWT 100% locally in browser memory via Base64URL and never makes any backend API call. Even so, as a general security best practice, avoid sharing active production secrets or long-lived tokens outside trusted local environments.
Why does my JWT exp claim have 10 digits instead of 13? +
RFC 7519 defines JWT NumericDate claims (exp, iat, nbf) as seconds since 1970-01-01T00:00:00Z (10 digits), whereas JavaScript Date.now() returns milliseconds (13 digits). Always divide milliseconds by 1000 and floor the result.
Does this tool verify the cryptographic JWT signature? +
No. Signature verification requires your HMAC secret or RSA/ECDSA public key and should happen inside your backend authorization middleware. This tool focuses on rapid local inspection of claims and expiration timing.
What is the difference between iat, nbf, and exp? +
iat (Issued At) records when the token was minted, nbf (Not Before) specifies the earliest UTC timestamp the token becomes valid, and exp (Expiration Time) defines the UTC timestamp after which the token must be rejected.