How the JWT Decoder Works
A JWT consists of three Base64URL-encoded segments separated by dots: header, payload, and signature. This tool splits the token on the dots, Base64URL-decodes each segment using TextDecoder for full UTF-8 correctness, and renders the parsed JSON. The algorithm (alg) and type (typ) from the header are displayed as badges. Standard registered claims (iss, sub, aud, exp, iat, nbf) are decoded with human-readable timestamps.
The optional HS256 signature verification uses the Web Crypto API (HMAC-SHA256) entirely in the browser. Enable it, enter your HMAC secret, and the tool verifies whether the signature matches. No data ever leaves your browser.
References
The JWT structure is defined in RFC 7519 — JSON Web Token (JWT) (rfc-editor.org/rfc/rfc7519). This RFC specifies the three-part structure, registered claim names (iss, sub, aud, exp, nbf, iat, jti), and the Base64URL encoding.
Signing algorithms (HS256, RS256, ES256, etc.) are defined in RFC 7518 — JSON Web Algorithms (JWA) (rfc-editor.org/rfc/rfc7518). This tool only verifies HS256 (HMAC-SHA256) in v1.
What's here, and what's not
Full JWT decoding: header (alg, typ), payload with all custom claims, signature display. Standard claims (exp, iat, nbf) rendered as human-readable ISO timestamps with relative time (e.g. 'expired 3 days ago'). Optional HS256 signature verification via Web Crypto. Security notice reminding you not to paste production tokens.
What isn't here: JWE (JSON Web Encryption) decryption — encrypted tokens require a private key and are fundamentally different from signed JWTs. RS256, ES256, PS256 signature verification — asymmetric algorithms require the public key in PEM or JWK format, which is v2. Token generation or signing is also not supported — this is a decoder and inspector, not an auth tool.
JWT Structure: Three Parts Explained
A JWT consists of three Base64URL-encoded parts separated by dots: header.payload.signature. Each part is independently encoded and can be decoded without any key.
Header: specifies the algorithm ("alg") and token type. Example: {"alg": "HS256", "typ": "JWT"}. Common algorithms: HS256 (HMAC-SHA256, symmetric), RS256 (RSA-SHA256, asymmetric), ES256 (ECDSA-SHA256).
Payload (claims): the data carried in the token. Standard claims: sub (subject/user ID), iss (issuer), exp (expiration timestamp), iat (issued at), nbf (not before). Custom claims can be added freely.
Signature: created by signing base64(header) + "." + base64(payload) with the server's secret key. Verifying the signature ensures the token wasn't tampered with.
The header and payload are NOT encrypted — they're only Base64URL-encoded. Anyone with the token can read them. Signatures ensure integrity, not confidentiality.
Related tools: Base64 Encoder / Decoder, JSON Formatter, Hash Generator, and URL Encoder.
JWT Security: Common Mistakes
Don't store JWTs in localStorage: vulnerable to XSS attacks. Prefer httpOnly cookies for browser storage — JavaScript cannot access httpOnly cookies.
Always verify the signature server-side: this tool decodes JWTs for inspection — it does NOT verify signatures (that requires the server's secret key). Never trust a JWT payload without signature verification.
Check expiry (exp): a JWT without an expiry claim lives forever. Always set exp and validate it on every request.
Algorithm confusion attacks: if your server accepts both HS256 and RS256, an attacker can create an HS256 token signed with the server's public key. Always specify exactly one algorithm in your JWT library configuration.
alg: "none" vulnerability: early JWT libraries accepted "alg": "none" and skipped signature verification. Always configure your library to require a specific algorithm.
Never put secrets (passwords, credit card numbers) in JWT payloads — they're readable by anyone who has the token.
Frequently Asked Questions
What is a JWT?
Is it safe to paste my JWT here?
What are the exp, iat, and nbf claims?
What is the difference between HS256 and RS256?
Where is the JWT specification documented?
Is it safe to decode a JWT in the browser?
How long should a JWT be valid?
By Bam's Thinkery — Updated