JWT Decoder
Decode JSON Web Tokens instantly. View header, payload, and expiration times. Runs entirely in your browser — your tokens never leave your device.
Privacy Notice
This tool runs 100% client-side. Your JWT is never sent to any server. All decoding happens in your browser.
About This Tool
The JWT Decoder is a privacy-focused developer tool for inspecting JSON Web Tokens. Paste any JWT token and instantly see its decoded header, payload claims, and time-related fields converted to human-readable dates. The tool runs entirely in your browser using JavaScript — your tokens are never transmitted to any server, making it safe to use with production tokens during debugging.
How JWTs Work
A JSON Web Token consists of three base64url-encoded parts separated by dots: the header, the payload, and the signature. The header typically contains two fields: "alg" (the signing algorithm, such as HS256 or RS256) and "typ" (the token type, always "JWT"). The payload contains claims — key-value pairs that carry the token's actual data. Claims can be registered (standard names like "sub" for subject, "exp" for expiration), public (custom names registered in the IANA JSON Web Token Claims registry), or private (application-specific names agreed upon by the parties). The signature is computed over the header and payload using the specified algorithm and a secret or private key, ensuring the token has not been tampered with.
Understanding Token Expiration
Most JWTs include an "exp" (expiration) claim that specifies when the token becomes invalid. This claim is a Unix timestamp — the number of seconds since January 1, 1970 UTC. Our decoder automatically detects time-related claims (exp, iat, nbf, auth_time) and displays them as human-readable local and UTC dates. The tool also shows a status badge indicating whether the token is currently valid, expiring soon (within 5 minutes), or already expired. This is invaluable when debugging authentication issues, as expired tokens are one of the most common causes of API 401 errors. The relative time display lets you quickly see how long until a token expires or how long ago it was issued.
JWT Security Considerations
It is a common misconception that JWTs are encrypted. They are not — the header and payload are merely base64url-encoded, which is a reversible encoding, not encryption. Anyone who obtains a JWT can read its contents. The signature provides integrity verification (proving the token has not been modified) and authentication (proving it was issued by a trusted party), but it does not provide confidentiality. This means you should never store sensitive information like passwords, credit card numbers, or personal identification numbers in JWT claims. If you need encrypted tokens, the JWE (JSON Web Encryption) standard extends JWT with payload encryption. For most web applications, standard signed JWTs are sufficient as long as they are transmitted over HTTPS and stored securely.
Common JWT Claims Explained
The JWT specification defines several standard claims. "iss" (issuer) identifies who created the token, typically your authentication server's URL. "sub" (subject) identifies the entity the token represents, usually a user ID. "aud" (audience) specifies the intended recipient, such as an API endpoint. "exp" (expiration time) sets the token's deadline. "nbf" (not before) prevents the token from being used before a certain time. "iat" (issued at) records when the token was created. "jti" (JWT ID) provides a unique identifier for the token, useful for preventing replay attacks. Beyond these standard claims, applications commonly add custom claims for roles, permissions, user email, organization ID, and other authorization-related data that the receiving service needs to make access control decisions.
Debugging with the JWT Decoder
When authentication fails in a web application, inspecting the JWT is often the first debugging step. Common issues revealed by decoding include: the token has expired (exp is in the past), the audience claim does not match the expected API (wrong aud), the issuer is unexpected (wrong iss, possibly a staging vs. production mismatch), required claims are missing (no role or permission), or the algorithm in the header does not match what the server expects. This decoder presents all this information in an organized, easy-to-scan format with color-coded status indicators, making it faster than manually base64-decoding in a terminal or writing throwaway code. The copy buttons for header and payload let you quickly share decoded token contents with teammates when collaborating on authentication issues.
Frequently Asked Questions
What is a JSON Web Token (JWT)?
Is it safe to decode JWTs in the browser?
What do the exp, iat, and nbf claims mean?
Why does this tool not verify JWT signatures?
How long should a JWT expiration time be?
What JWT signing algorithms are commonly used?
Was this tool helpful?