Home / Security & IDs

JWT Decoder: Inspect Headers, Payloads, and Claims

Runs locally in your browser. Your input is not uploaded.

Header
Payload
Time claims
ClaimUTCLocal

Signature: not verified

Decoding never checks the signature. Nothing is sent anywhere: the token is decoded in this page only.

A JWT decoder displays the readable header and payload of a compatible JSON Web Token. It helps troubleshoot authentication flows, inspect claim names, and understand expiration timestamps. Decoded values are unverified input until a trusted verifier checks the token and its expected context.

How to Use the JWT Decoder

Inspect a token’s readable parts and time-based claims locally.

  1. Paste the token into the token textarea; nothing is sent anywhere.
  2. Review the decoded Header and Payload shown as formatted JSON.
  3. Use the claims table to compare exp, iat, and nbf as UTC and local dates.
  4. Check the expired, valid, or not yet valid status shown for the token’s time-based claims.
  5. Inspect the displayed signature, while observing the notice that it is not verified.

Understanding the Anatomy of a JSON Web Token (JWT)

A JSON Web Token carries claims between systems. Applications often use JWTs in authentication and authorization flows, but the format itself does not determine what access a user should receive.

A common signed JWT uses compact JWS serialization with three dot-separated parts: a header, a payload, and a signature. Encrypted JWTs use a different structure and cannot be read by a simple header-and-payload decoder in the same way.

Common claims include iss for issuer, sub for subject, and aud for audience. Time claims such as exp, nbf, and iat use NumericDate values measured in seconds from the Unix epoch, rather than JavaScript's usual millisecond timestamps.

When troubleshooting, start with the actual failure: wrong audience, unexpected issuer, expiration, or a token intended for a different service. A payload that looks reasonable is useful diagnostic evidence, but it is not proof that the token should be accepted.

Header, Payload, and Signature: The Three Pillars of JWT

In a signed compact token, the header identifies metadata such as the signing algorithm. The payload contains the claims. The signature, or MAC for a symmetric algorithm, protects the signed representation against undetected modification when verification is performed correctly.

The header and payload are Base64url-encoded, so they are generally readable without a key. Signing does not hide their contents. Never place a password or private key in a payload merely because the token appears opaque.

A decoder can reveal a claim such as "role": "admin", but it cannot establish that a trusted issuer assigned that role. An attacker can create an encoded payload containing any role name.

For debugging, compare claim expectations with the receiving application's configuration. Keep displayed claims clearly marked as unverified, and interpret expiration labels as an aid to inspection rather than a server authorization decision.

Is it Safe to Decode JWTs Directly in the Browser?

Local decoding can reduce exposure compared with submitting a token to a remote inspection endpoint. It is useful for development when the browser page handles the token only in local memory and excludes it from telemetry.

However, an active bearer token may grant access to an account. Treat it like a credential even when the payload contains no obvious personal information. A page's scripts, browser extensions, session replay, clipboard history, and screenshots can create separate exposure paths.

Prefer short-lived development tokens or sanitized examples. Never put a token into a tool's URL query string, where it may enter history and logs. When sharing a bug report, describe the relevant claim mismatch and replace actual token values.

The Base64 encoder and decoder explains the encoding layer. It does not replace a JWT-aware verifier or the application's authentication middleware.

Common Security Vulnerabilities in Token-Based Authentication

Token vulnerabilities often come from accepting claims without enough verification. A server should verify the cryptographic protection, enforce an explicit set of allowed algorithms, and check issuer and audience against its own expectations. It should enforce relevant time claims and application-specific requirements as well.

Do not trust an algorithm or key location simply because the token header supplies it. Use established verification libraries and a controlled key-management process. Separate validation rules for different token types so an otherwise valid token cannot be reused in the wrong context.

Token theft is another risk. Cross-site scripting can expose credentials accessible to JavaScript; cookie-based designs require appropriate cookie settings and CSRF defenses for their request model. Choose storage and session behavior based on the application's threat model.

Finally, plan for logout, refresh, key rotation, and revocation requirements. A decoder can help inspect a failure, but secure authentication depends on the complete system.

Frequently Asked Questions

Can a JWT be decoded without the secret key?

A signed JWT’s header and payload are Base64url-encoded, not encrypted, so they can usually be decoded without a secret or private key. The signature cannot be trusted merely because those sections are readable. Verification requires the expected algorithm, an appropriate trusted key, and checks for claims such as issuer and audience.

Does decoding a JWT verify its signature?

No. This decoder displays the signature segment but does not verify it. A modified or fabricated token can contain plausible claims and dates. An application must verify the signature with a trusted library and key, restrict accepted algorithms, and validate the token’s intended issuer, audience, expiration, and other context before granting access.

How can I tell whether a JWT is expired?

The exp claim is a NumericDate measured in seconds since the Unix epoch. The claims table converts it to UTC and local dates and reports the current time-based status. A verifier may allow a small clock-skew tolerance, and a token without exp is not automatically safe or valid; application policy must decide whether expiration is required.

What do the iat and nbf claims mean?

The iat claim records when the token was issued, while nbf states the earliest time at which it should be accepted. Both use Unix-time seconds. iat can support age checks but does not by itself prove authenticity. A future nbf means the token is not yet valid, subject to any narrowly configured clock-skew allowance.

Is it safe to paste a production JWT into a decoder?

This tool decodes the token locally and sends no token input anywhere, but a production JWT is still a bearer credential in many systems. Prefer a redacted or test token, avoid screenshots and shared logs, and revoke exposed credentials when appropriate. Client-side decoding reduces one disclosure path; it does not make copying live credentials risk-free.

References: RFC 7519: JSON Web Token · RFC 8725: JWT Best Current Practices.