JWT Decoder & ValidatorSpecialized Version
🎟️

JWT Parser

Parse JWT tokens

JWT Parser

Parse JSON Web Tokens (JWT) into their three components: header, payload, and signature. Understand the structure and contents of any JWT.

JWT Structure

A JWT consists of three Base64URL-encoded parts separated by dots:

`` xxxxx.yyyyy.zzzzz header.payload.signature `

| Component | Contents | Encoding | HeaderAlgorithm (alg) and token type (typ)Base64URL PayloadClaims (iss, sub, exp, iat, etc.)Base64URL | Signature | Cryptographic signature | Base64URL |

JWT Parser Implementation

`javascript function parseJWT(token) { const parts = token.split('.');

if (parts.length !== 3) { throw new Error('Invalid JWT format - must have 3 parts'); }

const decode = (str) => { // Base64URL decode const base64 = str.replace(/-/g, '+').replace(/_/g, '/'); return JSON.parse(atob(base64)); };

return { header: decode(parts[0]), payload: decode(parts[1]), signature: parts[2] }; }

// Example usage const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';

const parsed = parseJWT(token); // header: { alg: 'HS256', typ: 'JWT' } // payload: { sub: '1234567890', name: 'John Doe', iat: 1516239022 } ``

Common JWT Claims

| Claim | Full Name | Description | issIssuerWho created the token subSubjectUser/entity identifier audAudienceIntended recipients expExpirationWhen token expires (Unix timestamp) iatIssued AtWhen token was created nbfNot BeforeToken not valid before this time jtiJWT IDUnique token identifier

Frequently Asked Questions

What is a JWT token?

A JSON Web Token (JWT) is a compact, URL-safe way to represent claims between two parties. It consists of three Base64URL-encoded parts: header (algorithm), payload (claims/data), and signature (verification). JWTs are commonly used for authentication and authorization in web applications.

Is parsing a JWT the same as verifying it?

No. Parsing only decodes the Base64URL content—anyone can do it without any secret. Verification requires checking the signature using the secret key or public key. Never trust JWT claims without verifying the signature first, as the payload can be modified without the key.

Can I decode a JWT without the secret key?

Yes. The header and payload are Base64URL-encoded, not encrypted. You can decode and read them without any secret. The signature cannot be verified without the secret, but the content is always readable. Never put sensitive data in JWTs—they are signed, not encrypted.

Related Tools

Explore other tools you might find useful:

Related Calculators