JWT Decoder & Token Inspector

Decode JSON Web Tokens (JWT) 100% offline in your browser with zero network calls: inspect HS256/RS256 headers, payload claims (exp, sub), and expiry live.

Token ExpiredExpires (exp): 2024-02-19T15:05:23.000ZIssued At (iat): 2024-02-19T12:18:43.000Z
Inspect in Epoch Converter →

What is a JWT? Anatomy of RFC 7519

A JSON Web Token (JWT), standardized in RFC 7519, is an open, compact, URL-safe container format for transmitting cryptographically verifiable claims between two parties. JWTs are the dominant mechanism for stateless authentication, session management, Single Sign-On (SSO), and OAuth 2.0 / OpenID Connect access tokens across modern cloud architectures.

A standard compact JWT is composed of three distinct base64url-encoded strings separated by periods (.):

header.payload.signature

  • 1. Header (JOSE Header): Defines token metadata, including the token type ("typ": "JWT") and the cryptographic signing algorithm (such as "alg": "HS256" or "alg": "RS256"). It may also specify a Key ID ("kid") indicating which public key in a JSON Web Key Set (JWKS) should be used to verify the signature.
  • 2. Payload (Claims Set): Contains the assertions (claims) about the subject (user or service). Claims fall into three categories: standard registered claims (iss, sub, exp), public claims, and custom private claims (such as user roles or tenant IDs).
  • 3. Signature: Generated by hashing the encoded header and payload with a secret key or private key. The signature guarantees data integrity: if an attacker modifies even a single character in the payload, the signature verification instantly fails.

Symmetric vs. Asymmetric Algorithms: HS256 vs. RS256 / ES256

When architecting authentication systems, choosing between symmetric and asymmetric cryptography is critical:

  • HS256 (HMAC with SHA-256): A symmetric algorithm where both the token issuer (auth service) and the token verifier (API server) share the exact same private secret string. HS256 is fast and lightweight, but poses security risks in distributed microservices: if any downstream service is compromised, attackers obtain the shared secret and can mint rogue admin tokens for the entire infrastructure.
  • RS256 / ES256 (RSA or ECDSA Public-Key Cryptography): An asymmetric algorithm where the authentication authority signs the token using a secret private key, while all external API microservices verify the signature using the corresponding public key. Because public keys can be distributed freely (typically via standard /.well-known/jwks.json endpoints), downstream APIs can verify tokens without possessing the authority to create them.

Critical JWT Security Vulnerabilities Every Engineer Must Know

JWTs introduce significant attack surfaces if backend verification is misconfigured:

  • The Algorithmic "none" Attack (CVE-2015-9235): The JWT specification permits an algorithm named "none" for unsecured tokens. Vulnerable backend libraries that blindly read the header's alg field would accept forged tokens whose algorithm was set to "none" with an empty signature! Modern backends must strictly whitelist allowed algorithms.
  • Key Confusion Attack (HMAC vs. RSA): In poorly written verifiers supporting both HS256 and RS256, an attacker takes the server's published public RSA key (which is publicly visible), converts the header to "alg": "HS256", and signs the token using the public key string as the HMAC symmetric secret. The server verifies the HMAC using its public key and erroneously accepts the token!
  • Decoding is Not Verification: Client-side tools (like this decoder) only deserialize Base64Url JSON strings so humans can inspect claims. Inspecting claims without cryptographically verifying the signature on a secure backend server provides zero authentication guarantees.

Standard RFC 7519 Registered Claims

When inspecting payload claims, you will encounter standard registered abbreviations:

  • iss (Issuer): Identifies the principal that issued the JWT (e.g. https://auth.company.com/).
  • sub (Subject): Identifies the principal that is the subject of the JWT (e.g. user ID usr_98124).
  • aud (Audience): Identifies the recipients that the JWT is intended for (e.g. https://api.company.com/v1/).
  • exp (Expiration Time): Unix timestamp in seconds after which the token must not be accepted.
  • nbf (Not Before): Unix timestamp identifying the time before which the JWT must not be accepted.
  • iat (Issued At): Unix timestamp indicating the time at which the JWT was created.
  • jti (JWT ID): Unique cryptographic nonce identifier for the token, used to prevent replay attacks.

Secure Token Storage: HttpOnly Cookies vs. LocalStorage

Where should client applications store access tokens?

  • LocalStorage (High XSS Risk): Any third-party script, analytics snippet, or browser extension running on your origin has full read access to localStorage. If an attacker discovers an XSS vulnerability on your site, they can steal tokens directly.
  • HttpOnly + Secure + SameSite Cookies (Recommended): An HttpOnly cookie cannot be accessed by client-side JavaScript, mitigating token theft via XSS. Paired with SameSite=Lax or SameSite=Strict, it provides strong defense against Cross-Site Request Forgery (CSRF).

Practical Real-World Use Cases

  • Diagnose rejected API requests: Inspect the exp (expiration) and nbf (not before) claims to see if a token was rejected due to timing or clock drift.
  • Debug role-based access control (RBAC): Examine custom role, scope, or permission claims in the payload to verify what privileges the client actually holds.
  • Troubleshoot identity provider integrations: Check the iss (issuer) and aud (audience) claims when an API rejects tokens from an OAuth or OIDC provider.
  • Verify token timestamps: Translate numeric epoch claims (iat, exp) into human-readable dates during authentication debugging.
  • Inspect header metadata: Check the alg (algorithm) and kid (key ID) header fields when debugging signature verification failures.

Absolute Privacy

Your tokens never touch our servers. OmniTools operates on a strict "Zero Server Upload" architecture. When you paste your JSON Web Token into this decoder, the string splitting, base64url decoding, JSON parsing, and claim inspection execute entirely within your local browser runtime.

Your authentication credentials, session tokens, and identity claims remain strictly confidential on your machine.

Frequently Asked Questions

Is it safe to decode production JWT access tokens in this tool?

Yes. Unlike server-side token debuggers, OmniTools decodes the Base64URL JOSE header and payload claims 100% locally inside your browser with zero network requests (enforced by connect-src self CSP). Your bearer tokens never leave your machine.

What are the three parts of a JSON Web Token (JWT) under RFC 7519?

A compact JWT consists of three dot-separated Base64URL strings: Header.Payload.Signature. The Header declares the signing algorithm (e.g., HS256, RS256, ES256), the Payload contains claims such as iss, sub, aud, exp, and iat, and the Signature verifies cryptographic integrity.