Diagnose JWT time claims without confusing local time and UTC
Use the JWT Decoder to examine exp, nbf, and iat values, compare rendered times, and isolate likely clock or unit mismatches.
By DevSphere Editorial · · 5 min read
Open JWT DecoderFrame the timing problem
A token that appears expired or not yet active can fail for several reasons: the claim may be wrong, the client clock may be skewed, the timestamp may have been produced in the wrong unit, or the server may apply a different policy. JWT Decoder provides a quick view of numeric `exp`, `nbf`, and `iat` claims and renders dates for inspection. Use a fabricated token, not an actual session token. The aim is to identify which claim to investigate, not to decide whether a production request should be authorized.
Open JWT Decoder and paste a dummy token into JWT Token. A valid sample has three segments separated by periods and JSON header and payload once decoded. The output shows a status banner, claim values, and timestamps. The decoder uses the browser clock for its status estimate and presents local display values. Record the raw numeric claim as well as the displayed date so that your diagnosis does not rely on a time zone-specific string.
Fictional claims: {"iat":1893456000,"nbf":1893456000,"exp":1893459600}
Expected UTC display: iat and nbf at 2030-01-01T00:00:00Z; exp at 2030-01-01T01:00:00Z.
Check the timestamp unit
JWT registered time claims are typically NumericDate seconds. A value accidentally supplied in milliseconds has many more digits and, when interpreted as seconds, points far beyond the intended date. Conversely, a seconds value treated as milliseconds appears near 1970. Look at the raw number first, then compare it to the ISO or local rendering. This application multiplies numeric claims by one thousand to construct a JavaScript date, which is the expected conversion from seconds to milliseconds.
Use `exp` to identify the intended expiration instant, `nbf` for the earliest allowed time, and `iat` for the issue time. The page's expiry banner is driven by `exp`; its active status display compares `nbf` with the current browser time. A missing `exp` appears as no expiration in the decoder. That observation does not mean the service's policy permits a non-expiring token, and a malformed or nonnumeric claim may not be handled as your production verifier handles it.
Compare local and shared clock references
Local date formatting varies by browser locale and time zone. When two engineers compare screenshots, they can see different clock strings for the same epoch value. Use the raw number or a UTC/ISO representation for a shared reference, and check both machines' system clocks. JWT Decoder shows local dates for claim details; the underlying value remains the authoritative numeric input for reproducing the tool's display. Document timezone and clock when capturing an issue.
If a server rejects a token shortly before its displayed expiration, inspect the server's allowed clock skew and the exact boundary rule in its verification library. This page does not apply the server's leeway policy, synchronize clocks, or inspect server logs. Do not extend an expiration in a real token or use a fabricated status as grounds to bypass a rejection. Instead compare issuer time, verifier time, and the intended policy in a controlled integration test.
Trace the issuer's serialization
In a test environment, follow the value from the issuer's date calculation through JSON serialization. Confirm that it is a number of seconds, not a quoted date string or milliseconds, and that no conversion is repeated. Compare the emitted token's `iat`, `nbf`, and `exp` values with the issuer's clock and intended lifetime. Use a synthetic identity and a low-risk test environment. The decoder can reveal the emitted claim shape, but it does not inspect issuer code or establish how the token was signed.
When claims are assembled from separate services, check whether one system's clock is consistently ahead or behind another. A `nbf` in the future can be correct if the token is intentionally scheduled, but it may also expose a unit or clock bug. An `iat` far in the future is a cue to inspect the producer and server policy, not proof of fraud. Keep the diagnostic focused on time fields and avoid sharing token strings beyond the authorized test team.
Resolve parsing errors and misleading displays
If no claim date appears, inspect whether the claim is present and numeric. A timestamp stored as a string may be displayed as an ordinary string rather than formatted. If decoding fails entirely, confirm the JWT has three parts and valid Base64URL-encoded JSON in its first two parts. Copying wrapped logs can insert quotes or omit characters. Use a safe sample button to check that the page works before troubleshooting an actual fixture.
The tool's status banner is a client-side date calculation and should not be called a token verification result. It does not check the signature, issuer, audience, token revocation, or policy-specific leeway. A time claim can be internally plausible while the cryptographic token is invalid. A signature can be valid while the claims are unacceptable. Keep those questions separate, and verify time behavior with the server library that will make the actual decision.
Record an actionable verification
A useful bug report for a time-claim issue includes a fabricated token or redacted decoded payload, the raw `iat`, `nbf`, and `exp` values, the intended UTC expiration, and approximate issuer and verifier clock times. Do not include an active token. State whether the mismatch was milliseconds versus seconds, a local-time display difference, or a genuine clock-skew observation. This makes the problem reproducible without disclosing credentials.
After correcting an issuer or clock configuration in the test environment, mint a new dummy token and repeat the comparison. Confirm the server's verifier accepts or rejects it as expected under its documented rules. Never assume that the decoder's green banner means a token is authenticated. The page is valuable for rendering claims and spotting timing anomalies; cryptographic verification and application policy remain responsibilities of the trusted backend.