Search tools...
Developer Tools

JWT Decoder Guide: How to Decode & Inspect JSON Web Tokens (2026)

Learn how JWTs work, decode tokens instantly, and debug authentication issues — all in your browser.

10 min readUpdated March 29, 2026JWT, Authentication, Developer Tools, API Security

JSON Web Tokens (JWTs) are the backbone of modern authentication — from API authorization to single sign-on. But when something goes wrong, you need to quickly decode and inspect the token to find the problem. This guide explains how JWTs work, what each part contains, and how to use our free JWT decoder to debug tokens instantly without exposing them to third-party servers.

Free Tool

Decode JWT Tokens — Free & Private

Paste any JWT and instantly see the decoded header, payload claims, expiry status, and algorithm. No signup, no server — runs entirely in your browser.

Open JWT Decoder →

What Is a JSON Web Token (JWT)?

A JSON Web Token (JWT, pronounced "jot") is a compact, URL-safe string used to securely transmit information between two parties. It's defined by RFC 7519 and is widely used for authentication and authorization in web applications and APIs.

Why JWTs Are Popular

  • Stateless: The server doesn't need to store session data — the token itself contains all necessary information.
  • Compact: Small enough to be sent in HTTP headers, URL parameters, or cookies.
  • Self-contained: The payload carries user identity and permissions, reducing database lookups.
  • Cross-domain: Works seamlessly across different domains and microservices.

JWTs are used by major platforms like Google, Auth0, Firebase, AWS Cognito, and virtually every modern API that uses OAuth 2.0 or OpenID Connect.

JWT Structure: Header, Payload, and Signature

Every JWT consists of three parts separated by dots (.):

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0In0.signature

Each part is Base64URL-encoded JSON:

1. Header

The header typically contains two fields:

  • alg: The signing algorithm (e.g., HS256, RS256, ES256)
  • typ: The token type, usually "JWT"
{
  "alg": "HS256",
  "typ": "JWT"
}

2. Payload (Claims)

The payload contains claims — statements about the user and metadata. There are three types:

TypeExamplesDescription
Registerediss, sub, exp, iat, audPredefined by the JWT standard
Publicname, email, roleCustom but commonly used
Privatecompany_id, planCustom claims for your app
{
  "sub": "user_1234",
  "name": "Jane Doe",
  "role": "admin",
  "iat": 1711670400,
  "exp": 1711756800
}

3. Signature

The signature is created by signing the encoded header and payload with a secret key (HMAC) or private key (RSA/ECDSA). It ensures the token hasn't been tampered with. Verification requires the secret or public key — which is why browser decoders can read but not verify tokens.

Common JWT Claims Explained

Understanding standard claims is essential for debugging authentication issues:

ClaimFull NameDescriptionExample
issIssuerWho created and signed the token"https://auth.example.com"
subSubjectThe user or entity the token represents"user_1234"
audAudienceIntended recipient (API or service)"https://api.example.com"
expExpirationUnix timestamp when the token expires1711756800
iatIssued AtUnix timestamp when the token was created1711670400
nbfNot BeforeToken is invalid before this time1711670400
jtiJWT IDUnique identifier to prevent replay attacks"abc-123-def"
Pro Tip

If your API returns 401 Unauthorized, the first thing to check is the exp claim — expired tokens are the #1 cause of auth failures.

JWT Signing Algorithms: HS256 vs RS256 vs ES256

The algorithm in the JWT header determines how the signature is created and verified:

AlgorithmTypeKeyBest For
HS256HMAC + SHA-256Shared secretSimple apps, same-server auth
HS384 / HS512HMAC + SHA-384/512Shared secretHigher security HMAC
RS256RSA + SHA-256Public/private key pairMicroservices, third-party verification
ES256ECDSA + SHA-256Public/private key pairMobile apps, performance-sensitive
PS256RSA-PSS + SHA-256Public/private key pairEnhanced RSA security

Which Should You Use?

  • HS256: Simplest option when both the issuer and verifier share the same secret (e.g., a single backend server).
  • RS256: The most common choice for distributed systems — the private key signs tokens, and any service with the public key can verify them. Used by Auth0, Google, and AWS Cognito.
  • ES256: Smaller signatures and faster verification than RSA — ideal for mobile and IoT applications.

How to Decode a JWT Token Online

Our free JWT decoder lets you inspect any token instantly without sending it to a server:

Step-by-Step

  1. Copy your JWT — from your browser's DevTools (Application → Cookies or Network → Headers), API response, or terminal.
  2. Paste into the decoder — the tool instantly splits the token into its three parts.
  3. Inspect the header — check the algorithm (alg) and token type.
  4. Review the payload — see all claims including user info, roles, and timestamps.
  5. Check expiry status — the tool compares exp to your current time and shows a green "Valid" or red "Expired" badge.
Privacy Note

Our decoder runs 100% in your browser using JavaScript. Your JWT token never leaves your device — no data is sent to any server. This is critical because JWTs often contain sensitive user information.

Debugging Common JWT Issues

When authentication breaks, JWTs are often the culprit. Here are the most common issues and how to diagnose them:

1. Token Expired (401 Unauthorized)

Decode the token and check the exp claim. If it's in the past, the token has expired. Solution: refresh the token using your refresh token endpoint, or request a new one.

2. Invalid Audience (403 Forbidden)

The aud claim doesn't match what the API expects. This happens when you use a token meant for one API with a different one. Check your OAuth configuration.

3. Token Not Yet Valid

If the nbf (Not Before) claim is set to a future time, the token won't be accepted yet. This can happen due to clock skew between servers.

4. Missing Required Claims

Some APIs require specific claims like role, scope, or permissions. Decode the token to verify these claims exist and have the expected values.

5. Algorithm Mismatch

The server expects RS256 but the token uses HS256 (or vice versa). This is also a known security vulnerability — always validate the algorithm server-side.

6. Clock Skew

If iat (issued at) is slightly in the future relative to the verifying server, it may reject the token. Most libraries allow a small leeway (typically 30–60 seconds).

JWT Security Best Practices

JWTs are powerful but can be dangerous if misused. Follow these best practices:

  • Keep tokens short-lived: Set exp to 15–60 minutes for access tokens. Use refresh tokens for longer sessions.
  • Never store secrets in the payload: JWTs are encoded, not encrypted — anyone can decode and read the payload. Never put passwords, API keys, or sensitive data in claims.
  • Always validate the algorithm: Explicitly set the expected algorithm server-side to prevent "alg: none" attacks.
  • Use HTTPS only: Transmit tokens only over HTTPS to prevent man-in-the-middle interception.
  • Store tokens securely: Use HttpOnly cookies (not localStorage) to prevent XSS attacks from stealing tokens.
  • Validate all claims: Always verify iss, aud, exp, and nbf server-side — not just the signature.
  • Rotate signing keys: Periodically rotate your signing keys and use the kid (Key ID) header to manage multiple keys.
  • Implement token revocation: Since JWTs are stateless, consider a token blocklist or short expiry + refresh token pattern for revocation.
Pro Tip

Never decode JWTs containing production credentials on third-party websites. Use a privacy-first tool like ours that processes everything locally in your browser.

JWT vs Session Tokens vs API Keys

Choosing the right authentication mechanism depends on your use case:

FeatureJWTSession TokenAPI Key
StatelessYes — self-containedNo — requires server-side storeNo — requires server lookup
ExpiryBuilt-in (exp claim)Server-managedUsually never expires
RevocationDifficult (needs blocklist)Easy (delete from store)Easy (delete key)
Payload dataYes (claims)No (just an ID)No (just a key)
Cross-domainEasy (Bearer header)Hard (cookie domain limits)Easy (header)
Best forSPAs, microservices, OAuthTraditional web appsServer-to-server, third-party

Many modern applications use a combination: JWTs for short-lived access tokens, refresh tokens stored as HttpOnly cookies, and API keys for external integrations.

How to Use the Tool (Step by Step)

  1. 1

    Copy Your JWT Token

    Get the token from your browser DevTools (Cookies or Network tab), API response, or terminal output.

  2. 2

    Paste into the Decoder

    Open the JWT Decoder tool and paste your token. It is instantly split into header, payload, and signature.

  3. 3

    Inspect Header & Algorithm

    Check the signing algorithm (HS256, RS256, etc.) and token type in the decoded header.

  4. 4

    Review Payload Claims

    Examine all claims — user ID, roles, permissions, issued time, and expiration.

  5. 5

    Check Token Validity

    The tool automatically compares the expiry time to your current time and shows whether the token is still valid or expired.

Frequently Asked Questions

Can this tool verify the JWT signature?+

No. Signature verification requires the secret key or public key, which should never be pasted into a browser tool. Our decoder only reads the Base64-encoded header and payload — it does not validate the cryptographic signature.

Is my JWT token sent to a server?+

No. All decoding happens 100% in your browser using JavaScript. Your token never leaves your device. This is important because JWTs often contain user identity and permissions data.

What does it mean if my JWT is expired?+

An expired JWT means the current time has passed the Unix timestamp in the "exp" claim. The token will be rejected by any properly configured server. You need to obtain a new token, usually via a refresh token endpoint.

Can I decode a JWT without the secret key?+

Yes. The header and payload of a JWT are only Base64URL-encoded, not encrypted. Anyone can decode and read them. The secret key is only needed to verify the signature — not to read the contents.

What is the difference between HS256 and RS256?+

HS256 uses a shared secret key for both signing and verification (symmetric). RS256 uses a private key to sign and a public key to verify (asymmetric). RS256 is preferred for distributed systems where multiple services need to verify tokens.

Why should I not store JWTs in localStorage?+

localStorage is accessible to any JavaScript running on the page, making tokens vulnerable to XSS (cross-site scripting) attacks. HttpOnly cookies are safer because JavaScript cannot access them.

Free — No Signup Required

Decode JWT Tokens — Free & Private

Paste any JWT and instantly see the decoded header, payload claims, expiry status, and algorithm. No signup, no server — runs entirely in your browser.

Open JWT Decoder →

Related Guides