JWT Decoder

Decode and inspect JSON Web Tokens

Tool Overview

The JWT Decoder allows you to decode and inspect JSON Web Tokens (JWT). JWTs are commonly used for authentication and authorization in web applications. This tool helps you view the token's header, payload, and verify its structure.

Go to Tool

How It Works

JWT (JSON Web Token) consists of three Base64-encoded parts separated by periods for secure transmission and authentication.

JWT Structure

Header.Payload.Signature Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ. SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Component Breakdown

  1. Header: Base64-encoded JSON containing:
    • alg: Algorithm used for signing (e.g., HS256, RS256)
    • typ: Token type (typically "JWT")
  2. Payload: Base64-encoded JSON containing claims:
    • iss: Issuer of the token
    • sub: Subject of the token
    • exp: Expiration time (Unix timestamp)
    • iat: Time the token was issued
    • aud: Audience the token is intended for
  3. Signature: Digital signature computed using the header-specified algorithm.
  4. Metadata: Auto-generated information derived from the payload:
    • token_status: Current status (Valid, Expired, or Not Yet Valid)
    • issued_at: Human-readable issued timestamp
    • expires_at: Human-readable expiration timestamp
    • time_remaining: Time remaining until expiration (e.g., "5d 3h 12m")

Decoding Process

  1. Split: The token is split at each period into three parts.
  2. Base64 Decode: Each part is decoded using Base64 URL-safe decoding.
  3. JSON Parse: The decoded strings are parsed into JSON objects.
  4. Display: The header and payload are displayed with syntax highlighting.

Important Notes

// The tool uses JavaScript's atob() function // with URL-safe character replacement: // '-' → '+' // '_' → '/' // WARNING: This tool only DECODES the JWT. // It does NOT verify the cryptographic signature. // Always verify signatures in production using the appropriate public key.

The tool also checks for common JWT structure issues and provides error messages for invalid tokens. Users should verify signatures using the appropriate public key in production environments.

Features

  • Decode JWT header and payload
  • Display decoded JSON with syntax highlighting
  • Show token expiration status
  • Display common claims (exp, iat, iss, sub, aud)
  • Copy decoded content to clipboard

Usage Examples

Example 1: Decode Standard JWT

Input:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ. SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Output:

{ "header": { "alg": "HS256", "typ": "JWT" }, "payload": { "sub": "1234567890", "name": "John Doe", "iat": 1516239022 }, "signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "metadata": { "token_status": "Valid", "issued_at": "Jan 18, 2018, 12:10:22 PM EST", "expires_at": null, "time_remaining": null } }

Example 2: Token with Expiration

Input:

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9. eyJzdWIiOiJ1c2VyMTIzIiwiZW1haWwiOiJ1c2VyQGV4YW1wbGUuY29tIiwiaWF0IjoxNjIwMDAwMDAwLCJleHAiOjE2MjAwODY0MDAsImlzcyI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tIn0. c2VjdXJpdHktc2lnbmF0dXJl

Output:

{ "header": { "alg": "RS256", "typ": "JWT" }, "payload": { "sub": "user123", "email": "user@example.com", "iat": 1620000000, "exp": 1620086400, "iss": "https://api.example.com" }, "signature": "c2VjdXJpdHktc2lnbmF0dXJl", "metadata": { "token_status": "Expired", "issued_at": "May 3, 2021, 12:00:00 AM EDT", "expires_at": "May 4, 2021, 12:00:00 AM EDT", "time_remaining": "Expired" } }

FAQ

What is a JWT?

JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object.

Does the decoder verify the token signature?

The tool decodes and displays the token content but does not verify the digital signature. For full verification, you need the secret or public key used to sign the token.

What are common JWT claims?

Common claims include: exp (expiration time), iat (issued at), iss (issuer), sub (subject), and aud (audience).