Developer

JWT Decoder

Paste any JWT to instantly decode its header and payload — inspect claims and expiration times in your browser.

Did this calculator help you?

What is JWT Decoder?

A JWT (JSON Web Token) is the standard way modern web APIs represent authentication and authorization claims. It's a compact, self-contained token made of three parts — a header describing the signing algorithm, a payload carrying the actual claims (like user ID, roles, and expiration), and a signature that lets the receiving server verify the token hasn't been tampered with. This decoder reads the header and payload instantly so you can debug authentication issues, inspect what claims an API is actually sending, or check when a token expires — all without needing a backend, a CLI tool, or pasting sensitive tokens into a third-party server, since everything runs locally in your browser.

When to Use This Calculator

  • Debugging why an API rejects a token by inspecting its claims and expiration time
  • Checking a token's expiration time during a support investigation or incident response
  • Verifying that an SSO or OAuth provider is issuing the claims your application expects
  • Learning how JWTs are structured for interview preparation or security coursework
  • Inspecting a token captured from browser dev tools or server logs to understand its contents
  • Comparing the header algorithm between tokens to debug algorithm-mismatch authentication failures

Steps:

  1. Paste your JWT into the input box, or click "Load Sample" to try one.
  2. The header and payload are decoded automatically as you type.
  3. Review claims like iss, sub, exp, and iat in plain readable form.
  4. Timestamp claims (exp, iat, nbf) are automatically converted to readable dates.

Formula

JWT = base64Url(header) + "." + base64Url(payload) + "." + base64Url(signature) Decoding: split on ".", base64Url-decode the first two parts, parse as JSON. Verifying (not done here): HMACSHA256(base64Url(header) + "." + base64Url(payload), secret) === signature

Use Cases

  • Debugging why an API rejects a token by inspecting its claims
  • Checking a token's expiration time during a support investigation
  • Verifying an SSO or OAuth provider is issuing the claims you expect
  • Learning how JWTs are structured for interview prep or coursework
  • Quickly inspecting a token pasted from browser dev tools or server logs

Key Benefits

  • Decode any JWT instantly without a backend or CLI tool
  • Everything runs client-side — tokens are never sent to a server
  • Automatically converts timestamp claims to readable dates
  • Free, no sign-up, works on any JWT regardless of algorithm

Pro Tips

  • Always check 'exp' first when debugging an "unauthorized" error — an expired token is the most common cause
  • Cross-reference the 'alg' in the header with what your backend expects to catch algorithm-mismatch bugs
  • Never trust a decoded payload as proof of identity without verifying the signature server-side
  • Use short-lived tokens with refresh tokens instead of long-lived JWTs to limit exposure if one leaks

Common Mistakes to Avoid

  • Assuming a decoded JWT is a verified JWT — decoding only reads the content, it doesn't confirm authenticity
  • Storing sensitive data (passwords, secrets) in the payload, forgetting it's readable by anyone
  • Pasting production tokens into untrusted online decoders
  • Confusing 'exp' (expiration) with 'iat' (issued at) when debugging token lifetime issues

Key Terms Explained

Claim: A piece of information asserted about a subject, like a user ID or role
Header: The first JWT segment, specifying the signing algorithm and token type
Payload: The second JWT segment, containing the actual claims
Signature: The third JWT segment, used to verify the token hasn't been altered

Related Concepts

Example

A token starting with eyJhbGciOiJIUzI1NiJ9 decodes to a header of {"alg":"HS256","typ":"JWT"} — telling you the token is signed with HMAC-SHA256.

Interpreting Your Results

The decoder splits the JWT on the two dot separators and Base64URL-decodes the first two segments. The header tells you the signing algorithm (like HS256 or RS256) and token type. The payload contains the actual claims — user identity, permissions, and timestamps. Timestamp claims (exp, iat, nbf) are automatically converted from Unix epoch to readable dates. If 'exp' shows a date in the past, the token is expired and most servers will reject it. The 'sub' (subject) claim typically contains the user ID, and 'iss' (issuer) identifies the server that created the token. Remember that decoding is not verification. The signature section is displayed but cannot be verified without the secret or public key. A decoded payload is informational only — never trust it as proof of identity without server-side signature verification.

Frequently Asked Questions

What is a JWT?
A JSON Web Token (JWT) is a compact, URL-safe way to represent claims between two parties. It consists of three Base64URL-encoded parts separated by dots: a header, a payload, and a signature.
Is it safe to paste my JWT into this tool?
Decoding happens entirely in your browser using JavaScript — the token is never sent to any server. That said, treat JWTs like passwords: avoid pasting tokens from production systems into any online tool, including this one.
Why can't this tool verify the signature?
Verifying a JWT's signature requires the secret key (for HMAC algorithms) or the public key (for RSA/ECDSA algorithms) that only the issuing server should have. This tool only decodes the readable header and payload — it never has access to that key.
What does the 'exp' claim mean?
'exp' (Expiration Time) is a Unix timestamp indicating when the token stops being valid. This tool automatically converts it to a readable date so you can quickly check whether a token has expired.
What is the difference between JWT and session tokens?
Session tokens are stored server-side and reference a server record. JWTs are self-contained — the token itself carries all the claims. JWTs enable stateless authentication across microservices without shared session storage.
What algorithms can a JWT use?
Common algorithms include HS256 (HMAC-SHA256, symmetric), RS256 (RSA-SHA256, asymmetric), and ES256 (ECDSA). The 'alg' header specifies the algorithm. The most common for web APIs is HS256 or RS256.
What is the difference between 'iat' and 'nbf'?
'iat' (Issued At) is when the token was created. 'nbf' (Not Before) is when the token becomes valid. If 'nbf' is in the future, the token should be rejected even if it hasn't expired yet.
Can a JWT contain sensitive data?
The header and payload are only Base64URL-encoded, not encrypted. Anyone can read them. Never store passwords, secrets, or sensitive personal data in a JWT payload. Only put non-sensitive claims like user ID, roles, and timestamps.
How long do JWTs typically last?
Access tokens usually last 15–60 minutes. Refresh tokens last hours to days. Short-lived access tokens with long-lived refresh tokens balance security with user experience.
What is a refresh token?
A refresh token is a long-lived token used to obtain new access tokens without requiring the user to re-authenticate. When the short-lived access token expires, the client sends the refresh token to get a fresh access token.
How do I copy the decoded claims?
The decoded header and payload are displayed as formatted JSON. You can copy the entire decoded output or individual claim values for debugging or documentation purposes.

Discover More Tools

Fresh picks from across our tool library.