Online JWT Viewer & Token Decoder

Decode, inspect, and audit JSON Web Tokens (JWT) according to RFC 7519 standards in real time. Header algorithms, payload user claims, expiration countdowns, and 100% in-memory privacy.

JWT Token Inspector & Claims DecoderActive Token
Red: Header • Blue: Payload • Green: Signature
HEADER: Algorithm & Token Type
{}
PAYLOAD: Data Claims & Subject
{}

The Complete Guide to JSON Web Tokens (JWT) & RFC 7519 Authentication

JSON Web Tokens (JWT), formally specified in IETF RFC 7519, represent an open, industry-standard, URL-safe compact means of representing claims securely between two parties. In modern distributed computing architectures, microservices, and Single Page Applications (SPAs), JWTs serve as the dominant bearer token mechanism for OAuth 2.0 authorization flows, OpenID Connect (OIDC) identity federations, and stateless REST API authentication.

Unlike traditional stateful server sessions that require central database lookups (such as Redis or Memcached) on every incoming API request, a JSON Web Token is completely self-contained. The token encapsulates user permissions, user IDs, tenant scopes, and expiration timestamps directly within its cryptographically signed payload. The HiFi Toolkit Online JWT Viewer enables security analysts, backend architects, and frontend developers to unpack, inspect, and audit JWT tokens, check validity countdowns, and verify cryptographic algorithms with zero software dependencies.

Anatomy of a JWT: Header, Payload & Cryptographic Signature

A compact JWT consists of three distinct Base64URL-encoded strings separated by dot (.) delimiters: header.payload.signature:

Header (Algorithm & Type)

A JSON dictionary declaring the signing algorithm ("alg": "HS256" or "RS256") and token type ("typ": "JWT"). Optionally includes a key ID ("kid") matching a public key in a JSON Web Key Set (JWKS).

Payload (User Claims)

The core data payload containing entity assertions (claims) about the subject, including registered claims (sub, iss, exp) and custom business claims (e.g., roles: ["admin"]).

Cryptographic Signature

Computed by hashing the encoded header and payload using the designated cryptographic algorithm and secret key. Guarantees message integrity and non-repudiation.

Standard ClaimRFC 7519 DefinitionTypical Payload Representation
sub (Subject)The principal identity (user or microservice) that the token represents."sub": "usr_98af21d09e"
iss (Issuer)The authority or identity provider (IdP) that generated and signed the token."iss": "https://auth.company.com/"
aud (Audience)The intended recipients or resource servers for which the token is authorized."aud": "https://api.company.com/v1/"
exp (Expiration)Unix epoch timestamp beyond which the token MUST NOT be accepted."exp": 1789721400 (Integer seconds)
nbf (Not Before)Unix epoch timestamp before which the token MUST NOT be accepted."nbf": 1789717800
jti (JWT ID)Unique identifier for the token, used to prevent replay attacks and track blacklists."jti": "c108b29c-6a0d-45fc"

Symmetric (HMAC) vs. Asymmetric (RSA/ECDSA) Signing Algorithms

Choosing the appropriate signing algorithm is one of the most critical architectural decisions in API security:

Symmetric Signing: HMAC SHA-256 (HS256)

Both the token issuer and all consuming backend microservices share the exact same private secret key. While fast and computationally lightweight, any service possessing the secret key can forge valid tokens. Best suited for monolithic architectures or closed internal clusters.

Asymmetric Signing: RSA & ECDSA (RS256, ES256)

The authorization server signs tokens using an ultra-secure private key. Downstream API gateways and resource servers verify the signature using an exposed public certificate (JWKS). Microservices can verify authenticity without the ability to forge tokens. Standard for OAuth 2.0 and enterprise cloud services.

Critical Security Pitfalls & Token Hardening Best Practices

When architecting JWT-based authentication, protect your infrastructure against these classic vulnerabilities:

  1. JWTs are NOT Encrypted by Default: Standard JWS tokens are simply Base64URL-encoded text. Never place passwords, credit card numbers, or sensitive PII inside token claims unless utilizing JSON Web Encryption (JWE).
  2. Keep Token Lifetimes Short: Because stateless JWTs cannot be revoked without maintaining a distributed blacklist, set access token expiration (exp) to 10–15 minutes, pairing them with rotating refresh tokens stored in HTTP-only, Secure cookies.
  3. Validate the Algorithm Explicitly: Never allow client-provided header algorithms to dictate backend verification. Explicitly configure your verifier to only accept the expected algorithm (e.g., strictly RS256), preventing algorithm confusion attacks.
  4. Enforce Audience & Issuer Checks: Always verify that aud matches your specific API endpoint to prevent cross-service token substitution.

The JOSE Family: JWS, JWE, JWK, and JWA Explained

JSON Web Tokens belong to the wider Javascript Object Signing and Encryption (JOSE) framework defined across multiple RFC standards:

StandardRFC SpecCore Function & Production Use Case
JWS (JSON Web Signature)RFC 7515Provides cryptographic integrity and origin authentication. The payload remains readable plain text (encoded via Base64URL), secured by an HMAC or digital signature.
JWE (JSON Web Encryption)RFC 7516Encrypts the payload contents using symmetric content encryption keys (e.g., AES-GCM) wrapped with asymmetric public keys (RSA-OAEP), guaranteeing complete confidentiality.
JWK (JSON Web Key)RFC 7517Defines a standard JSON data structure representing cryptographic keys (e.g., public keys served at an /.well-known/jwks.json endpoint for automated key rotation).
JWA (Cryptographic Algorithms)RFC 7518Catalogs allowed cryptographic primitives including HMAC (HS256/384/512), RSA (RS256, PS256), Elliptic Curves (ES256, ES384), and Edwards-curve (Ed25519).

Historical Vulnerabilities: The "none" Algorithm & Key Confusion

Two prominent security design flaws historically compromised naive JWT implementations:

  • The "none" Algorithm Exploit: RFC 7515 allows an unsecured token designated with "alg": "none" and an empty signature. Vulnerable backend libraries accepted these forged tokens without signature validation when developers failed to whitelist approved algorithms.
  • Asymmetric vs. Symmetric Key Confusion: When an API expects an RS256 token signed by the IdP's private key, an attacker changes the header to HS256 and signs the forged payload using the IdP's public key (which is publicly readable). In libraries that blindly execute verification with the configured key parameter, the public key string was treated as the HMAC shared secret, granting immediate unauthorized admin access.
  • Timing Attacks on Cryptographic Hash Comparison: Standard string equality checks (e.g. signature === expectedSignature) terminate execution on the first mismatched byte, leaking microsecond timing information that allows attackers to iteratively deduce valid HMAC signatures. High-security microservices must always utilize constant-time comparison primitives (such as Node.js crypto.timingSafeEqual()).

100% Client-Side Privacy & Data Security Assurance

Production JSON Web Tokens represent active user authentication credentials. Pasting live JWTs into public online decoders that transmit tokens to remote cloud servers exposes your production database to immediate account takeover, token interception, and severe regulatory non-compliance under GDPR and SOC 2.

HiFi Toolkit strictly implements a zero-server privacy architecture. All Base64URL string decoding, JSON formatting, claim parsing, and expiration calculations execute 100% locally within your client web browser memory using sandboxed JavaScript. Not a single token, secret key, or payload claim is ever uploaded or transmitted across external networks.

Frequently Asked Questions (FAQs)

An online JWT Viewer is a client-side security tool that decodes and inspects JSON Web Tokens (JWT) in accordance with the RFC 7519 specification. It separates the dot-delimited token string into its three constituent Base64URL-encoded components: the Header (cryptographic algorithm and token type), the Payload (user claims, roles, and expiration timestamps), and the Signature.

Yes, 100% private and secure. All Base64URL string decoding, JSON formatting, and Unix timestamp calculations execute exclusively inside your local web browser session memory using client-side JavaScript. Not a single token, secret key, or payload claim is ever uploaded or transmitted across external networks.

Standard Base64 utilizes the characters '+' and '/' and may include '=' padding, which require URL-encoding when used in query parameters or HTTP headers. Base64URL replaces '+' with '-' and '/' with '_', and omits trailing '=' padding, making the token safe for HTTP headers, URL query strings, and cookie values.

RFC 7519 defines reserved claims: 'iss' (Issuer) identifies the authentication server; 'sub' (Subject) identifies the authenticated user UUID; 'aud' (Audience) specifies the intended recipient resource server; 'exp' (Expiration Time) is a Unix epoch timestamp marking when the token becomes invalid; 'nbf' (Not Before) specifies the earliest time the token can be accepted; and 'iat' (Issued At) records the creation time.

Symmetric signing (such as HMAC-SHA256 or HS256) uses the exact same shared secret key to both sign and verify the token. Asymmetric signing (such as RSA-SHA256 or RS256, and ECDSA ES256) uses a private key to create the signature and a public key (often published via JWKS) for resource servers to verify authenticity without knowing the private signing key.

Because standard JWTs (JWS) are signed rather than encrypted, anyone can decode and read the claims. However, if an attacker modifies any character in the header or payload, the cryptographic signature will fail validation on the server unless the attacker possesses the signing secret key.

The 'alg: none' attack is a historic implementation vulnerability where vulnerable backend libraries accepted tokens declaring 'alg: none' in the header, bypassing signature verification entirely. Modern libraries and servers strictly disallow unsigned tokens in production.

The viewer extracts the numeric 'exp' claim, multiplies it by 1000 to convert seconds to JavaScript millisecond timestamps, and compares it against Date.now(). It visually indicates whether the token is currently active or expired, displaying the remaining validity duration in human-readable terms.

Explore Related Tools

Hand-picked utilities and calculators related to this tool.

Viewer Tools