JWT Decoder

Decode the header and payload of a JSON Web Token. Inspect claims, expiry and algorithm.

Decoded successfully

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.

header.payload.signature

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:

{ "alg": "HS256", "typ": "JWT" }

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

ClaimNameMeaning
issIssuerWho issued the token
subSubjectWho or what the token is about, usually a user ID
audAudienceWho the token is intended for
expExpiration timeUnix timestamp after which the token is invalid
nbfNot beforeUnix timestamp before which the token is invalid
iatIssued atUnix timestamp of issuance
jtiJWT IDA 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

A JWT payload is encoded, not encrypted. Base64URL decoding requires no key and takes milliseconds - this page does it entirely in your browser. Anyone who obtains a token, including the user it was issued to, can read every claim inside it. Never put passwords, payment details, personal identifiers or anything else confidential in a JWT payload.

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

AlgorithmTypeKeySuits
HS256HMAC + SHA-256One shared secretA single service signing and verifying
HS512HMAC + SHA-512One shared secretThe same, with a longer digest
RS256RSA + SHA-256Private signs, public verifiesMany services verifying, one issuing
ES256ECDSA + SHA-256Private signs, public verifiesThe same, with smaller keys and signatures
noneNo signature at allNoneNothing - reject these outright

Use asymmetric algorithms such as RS256 when multiple services need to verify tokens. Only the issuer then needs the private key.

The "alg: none" attack. Early JWT libraries honored a header claiming no signature was used, letting an attacker strip the signature and forge any claims they liked. A related attack switches RS256 to HS256 so the public key is used as an HMAC secret. Always validate against an expected algorithm on the server rather than trusting the header.

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.
Everything runs in your browser. This tool is implemented entirely in client-side JavaScript. Nothing you enter is transmitted to a server, logged or stored, which matters a great deal for anything security-related. You can verify this yourself by opening your browser's network tab and watching it stay empty while you work.

Using JWTs safely

  1. Keep access tokens short-lived - fifteen minutes is a common choice - and use refresh tokens for longer sessions.
  2. Always verify the signature server-side, against an explicitly expected algorithm.
  3. Validate exp, nbf, iss and aud on every request, not just the signature.
  4. Transmit only over HTTPS. A token is a bearer credential - whoever holds it can use it.
  5. Prefer httpOnly cookies over localStorage for browser storage, since localStorage is readable by any script running on the page.
  6. Keep the payload small. It is sent with every single request.
  7. Have a revocation strategy. Short expiry, a token ID denylist, or a token version claim you can invalidate.
Revocation is the hard part of JWTs. The advantage of a self-contained token is that no database lookup is needed - which is also why you cannot easily cancel one. Once issued, a JWT remains valid until it expires. Short lifetimes and refresh tokens are the standard answer, at the cost of some of the statelessness that made JWTs appealing.

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.

Related Calculators