🛠️
Astonishbuddy
No login required
JWT Decoder: How to Decode, Inspect, and Debug JSON Web Tokens
AstonishBuddy Blog

JWT Decoder: How to Decode, Inspect, and Debug JSON Web Tokens

✦
Mohit Patel
📅July 5, 2026
All Articles
Decode and inspect JSON Web Tokens locally in your browser. Understand JWT headers, claims, signature verification, expiration checks, and token security.

What Is a JWT (JSON Web Token)?

A JSON Web Token (JWT) is a compact, URL-safe token format used to securely transmit information between two parties. It is widely used for authentication and authorization in web applications, mobile apps, APIs, and microservices.

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

Header.Payload.Signature

For example:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.
SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Each section is Base64URL encoded and contains important information about the token.

What Does a JWT Decoder Do?

A JWT Decoder converts the encoded Header and Payload sections of a JWT into human-readable JSON. This allows developers to inspect claims, verify token structure, troubleshoot authentication issues, and understand what information is stored inside the token.

Our JWT Decoder processes the token locally in your browser, helping you inspect its contents quickly without sending your data to a server.

Understanding the Three Parts of a JWT

1. Header

The header specifies metadata about the token, such as the signing algorithm and token type. Example:

{
  "alg": "HS256",
  "typ": "JWT"
}

2. Payload

The payload contains claims or data stored within the token. Example:

{
  "sub": "1234567890",
  "name": "John Doe",
  "email": "john@example.com",
  "admin": true,
  "iat": 1719000000,
  "exp": 1719003600
}

3. Signature

The signature verifies that the token has not been modified after creation. It is generated using the encoded header, encoded payload, secret key or private key, and the signing algorithm. Without the correct signing key, the signature cannot be recreated or verified.

Why Use a JWT Decoder?

Developers frequently need to inspect JWTs during development or debugging. A decoder helps you view the token header, decode the payload instantly, inspect expiration dates, understand user claims, troubleshoot authentication problems, and debug API authorization issues.

Common JWT Use Cases

JWTs are commonly used in user login systems, REST APIs, OAuth authentication, Single Sign-On (SSO), mobile applications, microservices communication, and cloud platform authentication.

Example JWT

Encoded token:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJ1c2VySWQiOjQyLCJuYW1lIjoiQWxpY2UiLCJyb2xlIjoiYWRtaW4iLCJleHAiOjE3NTAwMDAwMDB9.
exampleSignature

Decoded Header:

{
  "alg": "HS256",
  "typ": "JWT"
}

Decoded Payload:

{
  "userId": 42,
  "name": "Alice",
  "role": "admin",
  "exp": 1750000000
}

How to Use This JWT Decoder

  1. Copy your JWT token.
  2. Paste it into the input box.
  3. Click Decode.
  4. View the decoded Header and Payload instantly.

Is Decoding the Same as Verifying?

No. A decoder only converts Base64URL-encoded data into readable JSON. It does not verify whether the token is authentic or signed correctly. Verification requires the appropriate secret key or public key used during token generation.

Cryptographic Signatures: Symmetric (HS256) vs. Asymmetric (RS256)

The security of a JSON Web Token relies entirely on its signature. There are two primary cryptographic signing schemes used across the industry:

  • HMAC with SHA-256 (HS256): A symmetric algorithm where both the authentication server that issues the token and the API server that verifies the token share the exact same secret key. This is simple and fast, but if any service that verifies tokens is compromised, an attacker can use the shared secret to forge new valid tokens.
  • RSA / ECDSA with SHA-256 (RS256 / ES256): An asymmetric public/private keypair algorithm. The identity provider signs the token using its private key, while client applications and resource APIs verify the signature using the provider's publicly distributed public key (frequently published via a JWKS / JSON Web Key Set endpoint). This is the standard for modern OAuth2 and OpenID Connect (OIDC) architectures.

Critical Security Pitfalls Developers Must Avoid

Because JWTs are encoded rather than encrypted, several security vulnerabilities frequently arise in web applications:

  • Never Put Passwords or Secrets in the Payload: Any user or browser extension that receives the token can decode the payload instantly using a decoder. Never store database passwords, API secrets, or credit card numbers in claims.
  • Always Verify the Algorithm Header: Historically, vulnerable libraries accepted tokens where "alg": "none" was specified, bypassing signature verification entirely. Modern verification libraries strictly enforce allowed signing algorithms.
  • Always Check Expiration (exp): Tokens should have short lifespans (e.g., 15 minutes) paired with secure HTTP-only refresh tokens. Verifying servers must reject any token where Date.now() > exp.

Why Local Browser-Based JWT Decoding Is Essential for Privacy

When troubleshooting production authentication errors, developers frequently copy real JWT tokens containing user emails, session IDs, and authorization roles. Pasting these tokens into public third-party decoding websites that log requests sends sensitive user tokens to external servers. Astonishbuddy's JWT Decoder processes tokens 100% locally in your browser memory, ensuring your authentication tokens never touch external servers or get stored in logs.

Is It Safe to Decode JWTs?

Decoding is generally safe because it simply reads the token contents. However, never share production tokens publicly and avoid exposing sensitive authentication credentials. For maximum privacy, use tools that perform decoding locally within your browser.

Common JWT Claims Explained

ClaimDescription
issToken issuer
subSubject identifier
audIntended audience
expExpiration time
nbfNot valid before
iatIssued at timestamp
jtiUnique token identifier

Advantages of JWT

  • Compact and URL-safe
  • Stateless authentication
  • Easy API integration and distributed systems support
  • Widely adopted industry standard

Limitations of JWT

  • Payload is readable after decoding (unless encrypted)
  • Large payloads increase request size
  • Revoking issued tokens can be challenging

Tips for Working with JWTs

  • Keep expiration times reasonably short.
  • Store tokens securely and always validate signatures on the server.
  • Use HTTPS to prevent interception.

Frequently Asked Questions

Can I modify a decoded JWT?

You can edit the decoded JSON, but changing it invalidates the original signature unless the token is re-signed with the correct key.

Does decoding reveal the secret key?

No. The signing secret or private key is never included inside the token.

Can expired JWTs still be decoded?

Yes. Even expired tokens can be decoded, although applications should reject them during verification.

Final Thoughts

Whether you're debugging an API, learning about authentication, or inspecting authorization claims, a JWT Decoder is an essential tool for developers. Simply paste your token to view its decoded Header and Payload in seconds, understand its structure, and diagnose authentication issues with confidence.

Found this helpful?

Explore more free tools and guides on AstonishBuddy.

← Browse All Articles🛠️ Explore Tools

More Articles