The formula
JWT = Base64URL(header) . Base64URL(payload) . Base64URL(signature)
Registered claims: iss (issuer), sub (subject), aud (audience), exp (expiry), nbf (not before), iat (issued at), jti (ID)
exp, nbf and iat are NumericDate values: seconds since 1970-01-01 UTC
Valid when nbf − leeway ≤ now < exp + leeway (and the signature verifies)
Worked example
- The sample token's header decodes to {"alg":"HS256","typ":"JWT"}.
- Its payload has iat = 1767225600 (1 January 2026, 00:00 UTC) and exp = 1767229200 (01:00 UTC), so its lifetime is 1 hour.
- Because that time has passed, the calculator reports it as expired, along with how long ago.
What a JWT is
A JSON Web Token (JWT, pronounced "jot") is a compact, URL-safe way to pass claims between systems, defined in RFC 7519. It's widely used for API authentication, single sign-on with OpenID Connect and session tokens. A JWT has three parts separated by dots: a header describing the signing algorithm, a payload of claims such as the user ID and expiry time, and a signature. The header and payload are just JSON encoded with Base64URL, so anyone holding the token can read them. The signature is what proves the token hasn't been tampered with.
Decoding is not verifying
This tool decodes the header and payload so you can inspect them, but it doesn't verify the signature, because that requires the secret key or the issuer's public key. Never trust the contents of a token in your application without verifying it with a well-tested library, checking the algorithm is one you expect, and validating the issuer, audience and expiry. Historic JWT vulnerabilities include accepting tokens with alg set to none and confusing symmetric and asymmetric algorithms. The calculator warns if a token is unsigned.
Expiry, issued-at and not-before
Time claims are stored as NumericDate values: seconds since the Unix epoch. exp is the moment the token stops being valid, iat is when it was issued and nbf is the earliest moment it may be used. The calculator converts all three to readable dates in your chosen time zone and shows how long remains. Short-lived access tokens, often 5–60 minutes, limit the damage if one is stolen, and are paired with longer-lived refresh tokens to get new ones. For any timestamp, use our Unix timestamp converter.
Clock skew and leeway
Servers' clocks are never perfectly in sync, so a token issued by one server might look slightly in the future, or already expired, to another. Most JWT libraries allow a small leeway, often 30–120 seconds, when checking exp and nbf. Set the leeway field to match your application's configuration to see whether a borderline token would be accepted. Keep leeway small, since it extends the window in which a stolen token can be used.
Security and privacy
Because JWT payloads are only encoded, not encrypted, they should never contain secrets such as passwords or sensitive personal data unless you use JSON Web Encryption (JWE). Treat tokens like passwords: anyone who has a valid token can use it. This page decodes tokens entirely in your browser; the token isn't sent to a server, and the field is excluded from share links. Even so, avoid pasting live production tokens into websites; use test tokens or tokens that have already expired.
Base64URL encoding
JWTs use Base64URL, a variant of Base64 that replaces + with - and / with _ and drops the = padding, so tokens can be used in URLs and HTTP headers without escaping. Each part's encoded length is about four thirds of its JSON size, and the signature adds 43 characters for HS256 and 342 for RS256 with a 2048-bit key. Large payloads make every request bigger, which is a reason to keep claims minimal. Our Base64 size calculator shows the overhead, and the password entropy calculator helps you choose strong secrets.