← Back to Tools

🔐 JWT Decoder & Analyzer

Decode any JWT — inspect the header and payload, and get an automatic vulnerability analysis. The signature is never transmitted; all decoding is done server-side with no external calls.

Paste a JWT (with or without 'Bearer ' prefix). The signature is never transmitted — decoding is local.

⚡ The alg:none Attack — Interactive Demo

See how an attacker forges a JWT by stripping the signature when the server accepts alg:none.

Step 1 — Steal a valid token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyIsInJvbGUiOiJ1c2VyIn0.SflKxwRJSMe…

Attacker intercepts a token belonging to a regular user (role: "user").

Step 2 — Forge a new header + payload
eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0 (alg: none)
eyJzdWIiOiJ1c2VyXzEyMyIsInJvbGUiOiJhZG1pbiJ9 (role: admin)

Changes alg to "none" in the header, role to "admin" in the payload. Both are just base64 — no key needed.

Step 3 — Submit forged token
eyJhbGciOiJub25lIn0.eyJyb2xlIjoiYWRtaW4ifQ.[empty]

If the server accepts alg:none, it skips signature verification — and the attacker is now "admin".

The fix: Always explicitly whitelist allowed algorithms server-side. Never accept alg:none from untrusted input. Use a JWT library that rejects alg:none by default — most modern ones do.

📚 How JWTs Work and Common Vulnerabilities

A JWT (JSON Web Token) is a compact, URL-safe string that carries claims between parties. It has three parts separated by dots: Header.Payload.Signature.

Header — declares the token type and signing algorithm (e.g. HS256, RS256).

Payload — contains the claims: who the user is, their role, when the token expires. This is encoded (base64), not encrypted — anyone can read it.

Signature — a cryptographic hash of the header + payload using a secret key. Prevents tampering — if the server validates it.

Key insight: The payload is public data. Never store passwords, secrets, or sensitive PII in a JWT. The signature only proves the token wasn't modified — it provides no confidentiality.

How to use this tool

  1. 1 Paste your JSON Web Token into the input field.
  2. 2 The tool decodes the header and payload sections immediately.
  3. 3 Check the claims: iss (issuer), sub (subject), exp (expiry), and aud (audience).
  4. 4 Verify the signature using your secret or public key to confirm the token was not tampered with.

Frequently asked questions

What is a JWT?
A JSON Web Token is a compact, URL-safe format for representing claims between two parties. It is widely used for authentication and authorization in APIs.
Is it safe to paste a real JWT here?
The tool runs in your browser and does not send tokens to a server. Still, avoid pasting production tokens from sensitive systems if possible. Use test tokens when auditing.
What does the 'alg: none' vulnerability mean?
Some implementations accept tokens with no signature algorithm specified, allowing attackers to forge tokens. Always verify the algorithm on the server side and reject 'none'.
What is the difference between JWT and session cookies?
JWTs are stateless -- the server does not need to look up session data. Session cookies require a server-side store. JWTs are harder to invalidate before expiry.

You might also like