PwnDeck logoPwnDeck

JWT Token Decoder

Decode JSON Web Tokens to inspect their header, payload, and signature. Verify token expiration and claims.

Advertisement

How to Use the JWT Decoder

  1. Paste your JWT token into the input field (the three Base64URL-encoded parts separated by dots).
  2. The tool instantly decodes and displays the header and payload as formatted JSON.
  3. Review the claims including algorithm, expiration (exp), issuer (iss), and custom claims.
  4. Check the signature status and token expiration timestamp.

What is a JSON Web Token (JWT)?

A JSON Web Token (JWT, pronounced 'jot') is a compact, URL-safe token format defined by RFC 7519 for securely transmitting claims between parties. A JWT consists of three Base64URL-encoded parts separated by dots: the header (specifying the algorithm and token type), the payload (containing the claims), and the signature (ensuring integrity). JWTs are widely used for authentication, authorization, and information exchange in modern web applications and APIs. The header typically contains the signing algorithm (HS256, RS256, ES256) and token type. The payload contains claims, which are statements about the user and metadata. Standard claims include iss (issuer), sub (subject), exp (expiration), iat (issued at), and aud (audience). Applications add custom claims for roles, permissions, and other session data. JWTs have been the target of numerous security vulnerabilities. The 'alg: none' attack tricks servers into accepting unsigned tokens. Algorithm confusion attacks exploit servers that accept both symmetric (HS256) and asymmetric (RS256) algorithms. Weak signing secrets can be brute-forced with tools like jwt_tool or hashcat. During penetration testing, always test for these vulnerabilities: try changing the algorithm to 'none', swap RS256 to HS256 with the public key as the secret, check for expired token acceptance, and look for sensitive data in the unencrypted payload.

Advertisement

Frequently Asked Questions

No. The JWT payload is only Base64URL-encoded, not encrypted. Anyone can decode and read the payload without the signing key. Never store sensitive information like passwords, credit card numbers, or personal data in JWT claims unless you use JWE (JSON Web Encryption), which is a separate standard.

HS256 (HMAC-SHA256) is a symmetric algorithm where the same secret key is used to sign and verify tokens. RS256 (RSA-SHA256) is asymmetric, using a private key to sign and a public key to verify. RS256 is preferred for distributed systems because the verification key can be shared publicly without compromising token creation ability.

Always verify the signature using the correct algorithm and key. Never trust the 'alg' header blindly; enforce the expected algorithm server-side. Check the exp claim to reject expired tokens. Validate the iss and aud claims. Use a well-maintained JWT library rather than implementing validation yourself, as subtle bugs can lead to critical vulnerabilities.

Yes. This tool decodes JWTs entirely in your browser. No token data is sent to any server. However, if the JWT contains sensitive claims, be aware that it is only decoded (not decrypted), so the data was readable by anyone with access to the token regardless.