JWT Decoder
Decode the header and payload of a JSON Web Token. Inspect claims, expiry and algorithm.
What is a JWT?
A JSON Web Token is a compact, self-contained way to transmit claims between parties. It consists of three Base64URL-encoded segments separated by dots: a header describing the algorithm, a payload containing the claims, and a signature proving the token has not been altered.
eyJhbGciOiJIUzI1NiJ9 . eyJzdWIiOiIxMjMifQ . dBjftJeZ4CVP...
The defining characteristic of a JWT is that it is self-contained. A server can validate a token and read its claims without a database lookup, which is what makes JWTs attractive for stateless authentication across distributed systems.
Key takeaways
- A JWT has three dot-separated parts: header, payload and signature.
- The payload is encoded, not encrypted - anyone holding the token can read it.
- Never put sensitive data in a JWT payload.
- This decoder reads tokens; it does not verify signatures.
- Tokens cannot easily be revoked before expiry, which is their main drawback.
The three parts
Header
Describes how the token is signed:
Payload
Carries the claims - statements about the subject and metadata about the token itself.
Signature
Computed over the header and payload using a secret or private key. It proves the token was issued by someone holding that key and has not been modified since.
Standard claims
| Claim | Name | Meaning |
|---|---|---|
| iss | Issuer | Who issued the token |
| sub | Subject | Who or what the token is about, usually a user ID |
| aud | Audience | Who the token is intended for |
| exp | Expiration time | Unix timestamp after which the token is invalid |
| nbf | Not before | Unix timestamp before which the token is invalid |
| iat | Issued at | Unix timestamp of issuance |
| jti | JWT ID | A unique identifier, used to prevent replay |
Beyond these, any custom claims can be added - roles, permissions, tenant identifiers. Keep them small; the token travels on every request.
Timestamps are in Unix epoch seconds. The Unix timestamp converter turns them into readable dates.
The payload is readable by anyone
The signature protects integrity, not confidentiality. It proves nobody altered the claims; it does nothing to hide them. If you need the contents hidden, you need JWE (JSON Web Encryption), which is a different specification.
Signing algorithms
| Algorithm | Type | Key | Suits |
|---|---|---|---|
| HS256 | HMAC + SHA-256 | One shared secret | A single service signing and verifying |
| HS512 | HMAC + SHA-512 | One shared secret | The same, with a longer digest |
| RS256 | RSA + SHA-256 | Private signs, public verifies | Many services verifying, one issuing |
| ES256 | ECDSA + SHA-256 | Private signs, public verifies | The same, with smaller keys and signatures |
| none | No signature at all | None | Nothing - reject these outright |
Use asymmetric algorithms such as RS256 when multiple services need to verify tokens. Only the issuer then needs the private key.
What this decoder does and does not do
- It decodes the header and payload from Base64URL and formats them as JSON.
- It explains the standard claims and converts timestamps to readable dates.
- It does not verify the signature, because that requires the secret or public key.
- A decoded token is not a valid token. Only the issuing server can confirm authenticity.
Using JWTs safely
- Keep access tokens short-lived - fifteen minutes is a common choice - and use refresh tokens for longer sessions.
- Always verify the signature server-side, against an explicitly expected algorithm.
- Validate exp, nbf, iss and aud on every request, not just the signature.
- Transmit only over HTTPS. A token is a bearer credential - whoever holds it can use it.
- Prefer httpOnly cookies over localStorage for browser storage, since localStorage is readable by any script running on the page.
- Keep the payload small. It is sent with every single request.
- Have a revocation strategy. Short expiry, a token ID denylist, or a token version claim you can invalidate.
Frequently Asked Questions
What is a JWT?
A JSON Web Token - a compact, self-contained way to transmit claims between parties. It has three Base64URL-encoded parts separated by dots: a header naming the algorithm, a payload of claims, and a signature proving the token has not been altered.
Is a JWT encrypted?
No. The payload is Base64URL-encoded, which anyone can decode instantly without a key. The signature proves integrity - that nobody changed the claims - but provides no confidentiality. Never put sensitive data in a JWT payload.
Does this tool verify the signature?
No. Verification requires the secret or public key used to sign the token, which you should never paste into a third-party tool. This decoder reads the header and payload only. A decoded token is not a verified token.
Is my token sent anywhere when I decode it?
No. Decoding happens entirely in your browser using JavaScript. Nothing is transmitted, logged or stored, which is essential for a tool handling credentials.
What do the standard JWT claims mean?
iss is the issuer, sub the subject (usually a user ID), aud the intended audience, exp the expiry timestamp, nbf the earliest valid time, iat when it was issued, and jti a unique token identifier. All timestamps are Unix epoch seconds.
What is the "alg: none" vulnerability?
Early JWT libraries honored a header claiming no signature was used, allowing attackers to strip the signature and forge any claims. A related attack switches RS256 to HS256 so the public key is misused as an HMAC secret. Always validate against an explicitly expected algorithm server-side.
Where should I store a JWT in a browser?
An httpOnly cookie is safer than localStorage, because localStorage is readable by any JavaScript running on the page, making it vulnerable to cross-site scripting. Cookies need CSRF protection in turn, so neither option is free of trade-offs.
How do I revoke a JWT?
You largely cannot, which is the main drawback of self-contained tokens. The standard answers are short expiry times with refresh tokens, a denylist of revoked token IDs, or a version claim you can invalidate server-side. Each sacrifices some of the statelessness that made JWTs attractive.
How long should a JWT last?
Access tokens are commonly given fifteen minutes to an hour, with longer-lived refresh tokens handling session continuity. Short lifetimes limit the damage if a token is stolen, since it cannot easily be revoked before it expires.