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 instantly with our free online parser. All processing happens locally in your browser for complete privacy.

Understanding JWT Structure

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

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

ComponentContentsPurpose
HeaderAlgorithm (alg), token type (typ)Tells how to verify the signature
PayloadClaims (iss, sub, exp, iat, custom)The actual data/claims
SignatureHMAC or RSA signatureProves the token wasn't tampered with

Example JWT Decoded

Token: ` eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c `

Parsed Header: `json { "alg": "HS256", "typ": "JWT" } `

Parsed Payload: `json { "sub": "1234567890", "name": "John Doe", "iat": 1516239022 } `

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'); }

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

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

// Node.js version function parseJWTNode(token) { const parts = token.split('.'); return { header: JSON.parse(Buffer.from(parts[0], 'base64url').toString()), payload: JSON.parse(Buffer.from(parts[1], 'base64url').toString()), signature: parts[2] }; } ``

Standard JWT Claims Reference

ClaimFull NameDescriptionExample
issIssuerWho created the token"auth.example.com"
subSubjectUser/entity identifier"user_123"
audAudienceIntended recipients"api.example.com"
expExpirationWhen token expires1735689600
iatIssued AtWhen token was created1735686000
nbfNot BeforeToken not valid before1735686000
jtiJWT IDUnique token identifier"abc123"

Where JWTs Are Used

  • Authentication: Login sessions and user identity
  • OAuth 2.0: Access tokens and ID tokens
  • API Authorization: Bearer tokens in HTTP headers
  • Single Sign-On (SSO): Sharing identity across services
  • Microservices: Service-to-service authentication

Security Notes

  • Parsing ≠ Verification: Anyone can parse a JWT; verification requires the secret key
  • Not Encrypted: JWT contents are readable by anyone with the token
  • Check Expiration: Always verify exp claim before trusting a token
  • Validate Issuer: Ensure iss matches your expected authentication server

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