Decode, verify, and audit JSON Web Tokens in your tab
Paste any JWT to decode its JOSE header and payload claims in your browser with zero network calls. Verify HS256, RS256, and ES256 signatures with WebCrypto. Flag alg:none, check expiry claims, and compare cookie vs storage risk.
Inspecting synthetic ES256 session token in your browser tab...
eyJhbGciOiJFUzI1NiJ9.eyJzdWIiOiJ1c3JfZGVtbyJ9.c2lnbmF0dXJl
- Algorithm and type
- ES256
- Signature status
- Checking
- Token lifetime
- Active
- Security audit
- 0 flags
ECDSA P-256 · JWS
WebCrypto subtle.verify
Checking exp and nbf
Evaluating JOSE and claims
Inspect JOSE headers, claims, and signatures
Paste a compact header.payload.signature string or Authorization: Bearer header below. Everything stays inside this browser tab.
Load a synthetic demo token
1. Decoded JOSE header
ES256 · JWT{"alg":"ES256","typ":"JWT"}- Signing algorithm (alg)
- ES256
- Token type (typ)
- JWT
- Key ID (kid)
- None
- Signature segment
- 64 bytes · base64url
- Header key-injection check (jku, jwk, x5u)
- No untrusted key URL or inline JWK header present.
2. Payload claims and security audit
0 FLAGS{"sub":"usr_8f31a9c2"}Decoded timestamp claims (UTC and relative)
- exp
- Evaluating...
Security audit and cookie vs storage risk
- Evaluating token claims...
3. WebCrypto signature verifier
Paste an HMAC shared secret for HS256/HS384/HS512, or a public key in JSON JWK or BEGIN PUBLIC KEY PEM SPKI format for ES256 and RS256.
Ready to verify signature via window.crypto.subtle.
Combined decoded JWT + audit report (#jwt-audit-json)
{"status":"ready"}Pin algorithms on the server and lock cookies in the browser
Most JWT bugs come from trusting the unverified header or keeping raw bearer tokens in localStorage. Use these two defaults in production.
1. Enforce algorithm, issuer, audience, and max age
Pass a fixed algorithms list so alg: "none" and key-confusion payloads fail before claims run.
import { jwtVerify, importSPKI } from 'jose';
const publicKey = await importSPKI(process.env.AUTH_ES256_PUBLIC_KEY!, 'ES256');
// Pin algorithms, issuer, audience, and max token age explicitly
const { payload } = await jwtVerify(rawToken, publicKey, {
algorithms: ['ES256'],
issuer: 'https://auth.example.com',
audience: 'https://app.example.com',
maxTokenAge: '15m',
});2. Store browser tokens in a __Host- HttpOnly cookie
Combine HttpOnly, Secure, SameSite=Lax, and a 15-minute Max-Age.
// Keep browser session JWTs out of localStorage so XSS cannot read them
res.setHeader(
'Set-Cookie',
[
`__Host-session=${signedJwt}`,
'Path=/',
'Max-Age=900',
'Secure',
'HttpOnly',
'SameSite=Lax',
].join('; ')
);JOSE header, RFC 7519 claim, and pitfall reference
RFC 7515 and RFC 7519 define the core JWT header fields and payload claims. Check every field below before trusting a caller identity.
Nine core JWT header parameters and registered claims
What each field means on the wire and what your backend verifier must enforce.
| Field | Section | Purpose | Verifier rule |
|---|---|---|---|
| alg | JOSE header | Names the signing algorithm, such as ES256, RS256, or HS256. | Pin an explicit server allowlist. Reject none and unexpected families. |
| kid | JOSE header | Selects which key ID verified the token during key rotation. | Match against a static JWKS map. Never pass raw kid into SQL or file paths. |
| iss | Payload claim | Identifies the auth server or tenant that minted the token. | Compare against the exact issuer string your backend trusts. |
| sub | Payload claim | Identifies the user or workload principal for the session. | Scope sub per issuer so two identity providers never collide. |
| aud | Payload claim | Names the API or service meant to accept the token. | Reject tokens minted for sibling apps or external services. |
| exp | Payload claim | Sets the Unix timestamp (seconds) when the token expires. | Require exp on session tokens and keep lifetimes short (5 to 15 minutes). |
| nbf | Payload claim | Sets the earliest Unix timestamp when the token becomes active. | Reject tokens before nbf, allowing only a few seconds of clock skew. |
| iat | Payload claim | Records the Unix timestamp when the issuer minted the token. | Use iat to enforce max session age or revoke tokens minted before a password reset. |
| jti | Payload claim | Assigns a unique token ID to spot replays on one-time flows. | Cache seen jti values until exp on high-risk actions or refresh exchanges. |
Six common JWT security pitfalls and fixes
Classic implementation mistakes that let attackers forge claims or lift bearer tokens.
| Pitfall | Failure mode | Defense |
|---|---|---|
| alg: "none" signature bypass | An attacker sets "alg": "none" and drops the signature segment to forge admin claims. | Pin a fixed algorithm list like ["ES256"] and reject empty signatures. |
| RS256 to HS256 key confusion | An attacker switches alg from RS256 to HS256 and signs the token using your public RSA key. | Bind each key object to one algorithm family. Never pass a public key into HMAC checks. |
| jku, x5u, and embedded jwk headers | The token header supplies an attacker URL or inline public key that a naive library trusts. | Ignore jwk, jku, and x5u in untrusted headers. Load keys only from your pinned JWKS origin. |
| Secrets inside readable JWS payloads | Teams put API keys or password hashes in JWS claims. Base64url is plain text. | Keep only opaque IDs and scopes in JWS claims, or encrypt the token as a JWE. |
| Missing exp or unchecked aud | Tokens without exp never expire if leaked. Tokens without aud replay on sibling APIs. | Require exp, iss, and aud on every check. Cap browser access tokens at 15 minutes. |
| localStorage vs __Host- HttpOnly cookies | Any XSS script on your site can read localStorage and steal raw bearer tokens. | Store browser session tokens in a __Host- cookie with Secure, HttpOnly, and SameSite=Lax. |
Why valid JWTs still face account takeover and scraping
A valid JWT signature only proves your server minted the token. Attackers still mint real tokens through password sprays on /login. They also replay stolen tokens across hundreds of API calls. camada never reads Authorization or Cookie values. Watchkeeper links track('login_failed') events and request rates across routes. That catches password sprays and scrapers inside your app.
1
Authorization and Cookie values stay in your app
camada SDKs strip Authorization headers, Cookie values, and request bodies inside your process. Raw JWTs and session secrets never leave your servers.
2
Spot password sprays with hashed track() events
A valid JWT cannot show if an attacker guessed 40 passwords first. Calling track("login_failed") links failed logins across accounts. Raw emails stay hidden.
3
Verify live cookie flags on your public routes
Scan your live login and app URLs with our website security tool. Confirm that cookies set Secure, HttpOnly, SameSite, and __Host- flags.
Check cookies, headers, CORS, and bot signals together
Scan your live routes for HttpOnly cookie flags, audit your Content-Security-Policy against XSS, or test CORS credential rules. Add one open-source camada SDK when you want in-app session scoring.
- Website security and cookie check
- CSP and security headers check
- Live CORS preflight checker
- Live bot signal test
- HAR sanitizer
- All developer tools
- Credential stuffing guide
SDK guides
session: ses_7f3a9c1e04b2 · action: blocked
This session submitted login attempts for many different accounts with one password pattern. The failure rate and pacing match a stolen-credential list being replayed.
- 38 login attempts for 36 different usernames in 3 minutes
- 97% of attempts returned an invalid credentials response
- Requests spaced at near-identical intervals of about 4.7 seconds
- Login form posted with no prior page view of the form
Questions about JWT decoding and security
Want to guard login and API routes without touching raw session tokens? Read the credential stuffing guide or check plans and limits.
- Does pasting a JWT on this page send my token over the network?
- No. Decoding, claim checks, and signature checks run 100% inside your browser tab. This page makes zero network calls, sets zero cookies, and writes nothing to storage. Even so, use test or expired tokens when you can.
- Can anyone read the payload inside a standard JWT without my secret key?
- Yes. Standard JSON Web Tokens (JWS) base64url-encode the header and payload in plain view. The signature only stops tampering; it does not hide the data. Anyone who sees the token can decode every claim in milliseconds. Never place raw passwords, API keys, or unencrypted secrets inside a JWS payload.
- What is the JWT alg:none or RS256-to-HS256 confusion bug?
- Broken JWT setups trust the alg field inside an untrusted token header. An attacker could set "alg": "none" to strip the signature. Or they could switch "alg" from RS256 to HS256 and sign with your public RSA key. Always pin an explicit algorithm allowlist in your verifier.
- Should I store session JWTs in localStorage or an HttpOnly cookie?
- Storing tokens in localStorage exposes them to any XSS script on your origin. For browser apps, use a short-lived cookie with Secure, HttpOnly, and SameSite=Lax. Add the __Host- prefix too so JavaScript and sibling subdomains cannot touch the token.
- Does camada inspect my JWT payload or Authorization header?
- No. camada SDKs strip Authorization headers, Cookie values, and bodies inside your app. Watchkeeper spots password sprays through track('login_failed') hashes. It also flags high-rate scraping without ever touching your session secrets.
Use it from an AI agent
This page is also Markdown at /tools/jwt-decoder.md. Agents can also run the check itself, without the form.
decode_jwtin this tab, through WebMCPTakes
token. Decode a JSON Web Token in this tab: header, claims, and checks for alg none, expiry, not-before and issued-at times. It does not verify the signature; the page does that with a key. The token is not sent anywhere.What leaves this tab: Nothing. The token is decoded in this tab.
The MCP server needs no key. Every agent tool on this site is listed in the server card and on the tools page.
Related tools
- HAR sanitizer
Drop a HAR file and get a copy safe to send to support. Cookies, bearer tokens, JWTs, API keys, and passwords are redacted in your tab.
- CORS checker
Run a live OPTIONS preflight with a test Origin, or paste curl headers. Spot reflected origin leaks, wildcard credential bugs, and missing Vary headers.
- Login page check
Review your login page for HTTPS, form fields, cookie flags, and security headers. Paste two responses to spot account enumeration.
Stop password sprays before attackers mint valid tokens.
Install the SDK on the Free plan to score 100,000 events a month with no card. Enable in-app blocks and challenges on Starter ($59/month) or Growth ($249/month).
Free needs no card. A 14-day trial of Starter or Growth needs a card. Nothing is charged today. Cancel before the trial ends (the date is shown in the app) and you pay nothing. Otherwise the plan's monthly price starts on day 15.