JWT Decoder
Decode and inspect JSON Web Tokens online. Free JWT decoder that reveals header, payload, claims, and expiration details instantly.
About JWT Decoder
JSON Web Tokens (JWT) are an open standard for securely transmitting information between parties as a JSON object. A JWT consists of three parts: Header, Payload, and Signature.
Security Note: Never share JWTs containing sensitive information. This tool decodes but does not verify signatures.
How to Use JWT Decoder
Paste your JWT
Paste your full JSON Web Token (the three Base64URL parts separated by dots) into the input field. Decoding happens instantly.
View decoded header
The header reveals the signing algorithm (HS256, RS256, ES256), token type (JWT), and any custom header fields. Useful for understanding how the token was signed.
Inspect payload claims
The payload shows all claims: subject (sub), expiration (exp), issued-at (iat), audience (aud), issuer (iss), plus any custom claims. Crucial for debugging authentication and authorization.
Verify expiration
Check the 'exp' claim — if it's in the past (compared to current Unix timestamp), the token has expired and servers should reject it. The decoder shows expiration status visually.
When to Use JWT Decoder
Debugging authentication flows
When JWT-based auth doesn't work as expected, decode the token to inspect: claims (correct user ID? expected scopes?), expiration (still valid?), audience (intended for this service?), issuer (from trusted source?). Common bugs: expired tokens, wrong audience, missing required scopes — all visible in the decoded payload.
Understanding third-party tokens
When integrating with auth providers (Auth0, Okta, Cognito, Firebase), decode their tokens to learn the claim structure. Different providers add custom claims with different names (cognito:groups, auth0:user_metadata, https://hasura.io/jwt/claims). Understanding the structure is essential for using token data in your application.
Verifying token expiration during testing
When writing automated tests for token-protected endpoints, decode test tokens to verify their expiration is in the future (long-lived test fixtures) or has appropriate timeouts (testing token refresh logic). Compare 'exp' claim to current time to confirm validity.
Auditing token contents for security review
Security audits require checking what data is in tokens. Sensitive data (PII, internal IDs, role definitions) shouldn't be in JWT claims since they're easily decoded. Audit production tokens to ensure no secrets are leaked through the payload.
JWT Decoder Examples
Standard JWT decoding
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjMiLCJuYW1lIjoiQWxpY2UiLCJpYXQiOjE2MDAwMDAwMDB9.signatureHeader: {"alg":"HS256"}\nPayload: {"sub":"123","name":"Alice","iat":1600000000}The three Base64URL parts (header, payload, signature) are split on dots. Each is decoded from Base64URL to JSON. The signature is opaque — only verifiable with the secret key on the server. The header reveals signing algorithm; the payload reveals user identity and metadata.
Detecting expired token
Decoded payload: {"sub":"user_42","exp":1577836800}exp = 2020-01-01 00:00:00 UTC (EXPIRED)The 'exp' claim is a Unix timestamp. The decoder converts it to readable date and compares to current time. This token expired in 2020 — servers should reject it. Common debugging step when seeing 401 Unauthorized errors during auth flows.
Custom claims discovery
Decoded payload: {"sub":"alice","https://hasura.io/jwt/claims":{"x-hasura-default-role":"user"},"https://api.acme.com/permissions":["read","write"]}Custom claims: Hasura role, Acme permissionsAuth providers and applications add custom claims using namespaced URLs (a convention to avoid conflicts). Decoding reveals what data is being passed — useful for understanding access control logic and API permissions.
Tips & Best Practices for JWT Decoder
- 1.Never trust JWT claims without server-side signature verification. Anyone can craft a JWT with arbitrary claims; the signature proves it was issued by a trusted party. Verify signatures using the appropriate library and key.
- 2.Don't put confidential data in JWT payloads. They're encoded, not encrypted. Use opaque session IDs in JWTs that map to server-side data, or use JWE (encrypted JWT) for actual confidentiality.
- 3.Set short expirations on access tokens (15-60 minutes) and use refresh tokens for long-lived sessions. Stolen tokens should be useless quickly. Include 'jti' (JWT ID) for tracking and revocation if needed.
- 4.Standard claims (RFC 7519) have 3-letter abbreviations: iss, sub, aud, exp, nbf, iat, jti. Custom claims should use namespaced URLs to avoid conflicts with future standards or other libraries.
- 5.When debugging, also check the 'alg' header. None ('alg':'none') was a CVE in old libraries — they accepted unsigned tokens. Modern libraries reject 'none' but it's worth verifying. RS256 (asymmetric) is preferred for distributed systems; HS256 for single-service apps.
- 6.For very small tokens, consider not using JWT — opaque random tokens (UUID) referencing server-side session data have less overhead. JWT shines when you need stateless verification (no DB lookup) across multiple services.
Frequently Asked Questions
Related Tools
Base64 Decoder
Decode Base64 strings back to readable text online instantly. Free Base64 decoder for converting encoded data and content safely.
URL Decoder
Decode URL-encoded text online by converting percent-encoded characters back to readable text. Free URL decoder for web developers.
HTML Entity Decoder
Decode HTML entities back to readable characters online. Free HTML entity decoder for converting ampersand codes to plain text.
Hex to Text
Convert hexadecimal values to readable text online. Free hex to text decoder for parsing hex-encoded strings and binary data.
Binary to Text Converter
Convert binary code to readable text online instantly. Free binary to text decoder that translates ones and zeros to characters.
ROT13 Encoder/Decoder
Encode and decode text with the ROT13 substitution cipher online. Free ROT13 tool for simple text obfuscation and puzzle solving.