JWT Decoder + Verifier
Paste a JSON Web Token, split into header / payload / signature, verify with an HMAC secret. Auto-flags expired, not-yet-valid, and dangerous "alg none" tokens.
jwt · jose · hmac · hs256
Paste a JSON Web Token, split into header / payload / signature, verify with an HMAC secret. Auto-flags expired, not-yet-valid, and dangerous "alg none" tokens.
jwt · jose · hmac · hs256
A JWT (JSON Web Token) is header.payload.signature joined by dots, base64url-encoded, optionally signed. Understanding what each part holds and what the signature buys you covers ~80% of modern auth.
This lab takes a pasted token, splits it into three parts, base64url-decodes them, parses the JSON. Paste an HMAC-SHA256 secret and it verifies the signature client-side. exp, nbf, iat claims become human-readable timestamps; expired tokens are flagged red. The dangerous alg: "none" case is highlighted with a security banner.
{
"alg": "HS256",
"typ": "JWT"
}{
"sub": "1234567890",
"name": "Yiğit Yalım",
"iat": 1778699568,
"exp": 1778703168
}A JWT is the dot-joined concatenation of:
{ "alg": "HS256", "typ": "JWT" }sub (subject), iat (issued at), exp (expires at) are the most common:
{ "sub": "user-123", "iat": 1745731600, "exp": 1745735200 }HMAC(secret, base64url(header) + "." + base64url(payload)). Or RSA/ECDSA. To verify it you need the matching secret or public key.Three places where it goes wrong:
Accepting alg: "none" — some libraries (including old jsonwebtoken v0.x) accepted this algorithm; an attacker could forge unsigned tokens. Modern libraries reject it but you should still pass verify({ algorithms: ["HS256"] }) as an explicit allowlist.
Algorithm confusion — server expects RS256 (asymmetric) but an attacker submits a token signed with the public key as if it were an HMAC secret, switching to HS256. Again: explicit algorithms allowlist defeats this.
Decoding without verifying — jwt.decode() (not verify) only base64url-decodes, never checks the signature. Never use decode-only in production; always jwt.verify(token, secret, options).
exp vs nbf vs iat| Claim | Meaning | Server check |
|---|---|---|
iat | Issued at | Logging only — must not be in the future |
nbf | Not before | Reject if now < nbf |
exp | Expires at | Reject if now >= exp |
Allowing ±60-300 seconds of clock skew is common practice. More than an hour of tolerance opens auth-bypass risk.