Tool overview
What is a JWT Decoder?
A JWT decoder parses a JSON Web Token into header and payload claims so you can inspect algorithm, expiry, and custom fields.
Why use this JWT Decoder?
Debug auth tokens locally—never paste production JWTs into a public decoder that might log them.
Key Features
Header/payload inspection, claim formatting, local-only decode (no signature verification upload), and quick copy.
How to Use
Follow these steps to get accurate results from the tool interface above.
- Paste a complete JWT string (header.payload.signature) into the input panel — strip Bearer prefixes first.
- Review structured header and payload JSON for alg, typ, exp, nbf, iat, sub, and custom claims.
- Compare exp/nbf to UTC seconds if APIs return 401 despite a clean decode.
- Remember: this tool is decode-only — verify signatures in your backend with the issuer key or JWKS.
- Clear the editor after inspecting production-like tokens on shared machines.
JWT Decode Online / Debugger — Complete Guide
Authoritative walkthrough for an online JWT decoder and debugger: decode vs verify, expired tokens, auth debugging, claim inspection, key rotation, alg:none and exp/nbf fixes, Base64URL pitfalls, and privacy — aligned with the inspector above.
JWT Decoder guide — start here
This page is the canonical guide to inspecting JSON Web Tokens with DevUtilities’ JWT Decoder. Use the decoder above while you read, or jump to a topic below. Header and payload decoding runs entirely in your browser — tokens are never uploaded for verification or analytics.
What JWT Decoder does
JWT Decoder is a client-side inspector for compact JWS tokens (header.payload.signature). It Base64URL-decodes the first two segments, JSON-parses claims, and surfaces alg, typ, exp, nbf, iat, sub, and custom fields for debugging — without treating a successful decode as cryptographic proof.
What you get
- Three-segment split with structured header and payload JSON
- Visibility into registered claims (exp, nbf, iat, iss, aud, sub) and custom claims
- Clear separation between decode (this tool) and signature verification (your backend / JWKS)
- Local-only processing suitable for staging tokens and redacted production samples
Use this decoder when
- You need to see why an API returns 401 despite a “valid-looking” token
- You are comparing claim sets across environments during key rotation
- You want to confirm Base64URL segments before wiring a verifier
- You are teaching or documenting JWT shape without pasting secrets into a third-party site
Do not expect
- HMAC, RSA, or ECDSA signature verification — this tool is decode-only
- Automatic clock skew handling against a trusted NTP source
- JWKS fetch or issuer trust decisions
Decode vs verify — know the difference
Decoding proves only that segments are well-formed Base64URL JSON. Verification proves the signature matches a trusted key and that time/audience constraints pass. Confusing the two is a common auth bug.
Decode (this tool)
- Splits on '.' and requires three parts for compact JWS
- Base64URL-decodes header and payload, then JSON.parse
- Shows claims even when the signature is wrong, expired, or alg is none
Verify (your secure backend)
- Checks alg against an allowlist — never trust header.alg blindly
- Validates HMAC/RSA/ECDSA with issuer secret or JWKS public key
- Enforces exp, nbf, iss, aud, and optional jti replay controls
Step-by-step: inspect a compact JWT
Walk through a typical debug session with the decoder above.
- Copy the raw JWT only — strip Bearer prefixes, quotes, and trailing newlines from logs.
- Paste into the input panel; the tool splits header.payload.signature automatically.
- Read the header: confirm alg and typ match what your issuer is supposed to emit.
- Read the payload: check sub, roles/scopes, exp, nbf, and any tenant or environment claims.
- Compare exp and nbf to Math.floor(Date.now()/1000) in UTC if APIs reject the token.
- If claims look correct but APIs still fail, move to signature verification in your backend — do not assume decode equals trust.
- Clear the editor (and localStorage if used) after inspecting production-like tokens on shared machines.
Use case: debug intermittent 401s
Problem: a mobile client receives intermittent 401s. Logs show a JWT that “looks fine” in the network tab, but the API gateway rejects it.
How this tool helps
- Paste the failing token and confirm three segments decode without structure errors.
- Check alg — unexpected none, HS256 vs RS256 mismatches, or typ typos often explain gateway rejects.
- Inspect exp and nbf against UTC; clock skew and timezone bugs are frequent on devices.
- Compare custom claims (tenant, env, scope) to what the gateway policy expects.
- Hand the same token to your verifier with the correct JWKS/secret once claims look right.
Outcome: you separate malformed tokens, claim/policy mismatches, and true signature failures before changing client code blindly.
Use case: inventory access-token claims
Problem: product asks which claims ship in the access token after a new OIDC mapping. Docs are stale; you need a live sample.
How this tool helps
- Obtain a non-production access token from the staging authorize flow.
- Decode and list registered vs custom claims in the payload JSON.
- Note claim names and types (string vs number for NumericDate fields).
- Document the claim contract for API authors without sharing the signature secret.
Outcome: a concrete claim inventory for design docs — still remembering the token is not verified here.
Use case: signing-key rotation checklist
Problem: you are rotating signing keys. Some services still mint tokens with the old kid; others already use the new JWKS entry.
How this tool helps
- Decode tokens from each issuer path and record header.kid and alg.
- Confirm payload iss/aud still match during the dual-publish window.
- Flag tokens missing kid or using unexpected alg before cutting over verifiers.
- After cutover, spot-check that new tokens no longer reference the retired kid.
Outcome: a claim/header checklist for rotation — signature proof still happens in services that hold keys.
Fix: alg none and algorithm confusion
alg:none (or accepting arbitrary alg from the header) is a classic JWT attack against misconfigured libraries.
Why it happens
Some early libraries treated alg:none as “unsigned but valid,” or allowed attackers to switch RS256 tokens to HS256 and verify with the public key as an HMAC secret.
Diagnose
Decode the header. If alg is none, empty, or not on your allowlist, treat the token as hostile regardless of a pretty payload.
Fixes
- Configure verifiers with an explicit algorithm allowlist (e.g. only RS256 or only ES256).
- Reject tokens whose header.alg is none or missing.
- Never derive the verify algorithm solely from untrusted header input.
- Prefer asymmetric algorithms with JWKS rotation for public clients.
This decoder will still show the payload for alg:none tokens — visibility is not endorsement. Reject them in production verifiers.
Fix: exp / nbf time failures
APIs often return 401 when exp has passed or nbf is still in the future, even though the token decodes cleanly.
Why it happens
NumericDate claims are seconds since Unix epoch. Clients may compare milliseconds, apply local timezone offsets, or ignore clock skew windows.
Diagnose
Decode exp and nbf as JSON numbers. Compare to Math.floor(Date.now()/1000). String exp values or millisecond timestamps are malformed per RFC 7519.
Fixes
- Normalize comparisons to UTC seconds; allow a small skew (e.g. 30–60s) on both sides if policy permits.
- Ensure issuers emit NumericDate numbers, not ISO strings.
- Check device clock sync when only mobile clients fail.
- Confirm nbf is not set far in the future after a bad deploy.
Fix: Base64URL vs standard Base64
JWT segments use Base64URL (RFC 4648 §5): - and _ instead of + and /, with padding often omitted.
Why it happens
Pasting standard Base64, adding = padding incorrectly, or mixing alphabets breaks decode. Truncated copy-paste drops the signature segment.
Diagnose
Look for +/ in segments, spaces, Bearer prefixes, or fewer than three dot-separated parts. Valid JWT segments should be URL-safe.
Fixes
- Strip Bearer and whitespace before paste.
- Re-copy the full three-part token from the source — do not re-encode with standard Base64 tools unless you convert to Base64URL.
- When building tokens, use Base64URL without relying on atob/btoa alone for binary safety.
JWT segment & claim reference
Quick reference for compact JWS shapes and common pitfalls. Decoding success ≠ verification success.
JWT segment & claim reference
| Token / claim | Valid shape | Malformed / risky | Pitfall |
|---|---|---|---|
| Compact JWS | header.payload.signature (3 parts) | Two parts or Bearer-prefixed paste | Missing signature segment is a common log truncation issue |
| Header alg | Allowlisted alg (e.g. RS256) | alg:"none" or attacker-controlled alg | Never trust header.alg alone in verifiers |
| exp / nbf | JSON number (UTC seconds) | ISO string or milliseconds | Wrong type breaks library comparisons |
| Segment encoding | Base64URL (-_ , padding optional) | Standard Base64 (+/) | Wrong alphabet indicates corrupt paste or wrong encoder |
Security checklist
- Treat decode-only output as untrusted until a backend verifies the signature.
- Reject alg:none and unexpected algorithms in production.
- Do not paste long-lived refresh tokens on shared kiosks; clear local state afterward.
- Redact PII in screenshots of decoded payloads before sharing.
- Keep signing secrets and private keys out of browser workflows — use JWKS on the server.
JWT debugging best practices
- Document the claim contract (names, types, lifetimes) separately from verification code.
- Prefer short-lived access tokens; put sensitive authorization in server sessions when possible.
- Log kid and iss during incidents — not full tokens — when retention policies allow.
- Use this decoder for shape and claims; use automated tests against a real verifier for security gates.
- During key rotation, dual-publish JWKS and monitor kid distribution before retiring keys.
Privacy — tokens stay local
All Base64URL decoding and JSON parsing run in your browser. Tokens are not sent to a verification endpoint, JWKS proxy, or analytics pipeline from this utility.
- Optional localStorage persistence (if enabled by the workspace) stays on your device origin only.
- Decoded payloads may contain PII — handle output like sensitive logs.
- Clear the editor after debugging production-like tokens.
Frequently Asked Questions
Expandable answers for common debugging bottlenecks and data privacy questions.
Official Documentation & References
Authoritative specifications and platform documentation for this utility.