Skip to content
ToolkitHub

JWT Token Parser

Parse JWT header, payload, signature

Guide

Anatomy of a JSON Web Token

By Logappradeep · ServiceNow developer

A JWT looks like a random string, but it has a precise structure defined by RFC 7515 (JSON Web Signature) and RFC 7519 (JSON Web Token). This parser breaks a token into its parts as you type, color-codes each segment in the original string, and decodes the readable ones, which makes it a useful learning aid as well as a debugging tool.

The compact serialization

A signed JWT is three Base64URL strings joined by dots:

xxxxx.yyyyy.zzzzz
header.payload.signature
  • Header (red): a JSON object describing how the token is secured.
  • Payload (purple): a JSON object containing the claims.
  • Signature (blue): raw bytes produced by signing header.payload, encoded as Base64URL.

The dots are not encoded and never appear inside a segment, which is why splitting on them is safe.

Why so many tokens start with "eyJ"

Every header and payload is a JSON object, so it begins with {". Those two bytes always encode to eyJ in Base64URL. Spotting eyJ in a header, cookie, or log line is a reliable hint that you are looking at a JWT, and if you see it twice in one string, separated by a dot, you almost certainly are.

Base64URL, not plain Base64

JWTs travel in URLs, HTTP headers, and cookies, so they use the URL-safe alphabet from RFC 4648: - replaces +, _ replaces /, and trailing = padding is removed. A standard Base64 decoder may reject a segment until those characters are swapped back and the padding is restored. The parser handles that conversion for you.

Header parameters you will see

  • alg: the signing algorithm, such as HS256, RS256, or ES256.
  • typ: usually JWT; some specifications use values such as at+jwt for access tokens.
  • kid: a key ID that tells the verifier which key from a key set to use, which is essential for key rotation.
  • cty: content type, used when a JWT is nested inside another.

Variations to recognize

  • Five segments means an encrypted JWE token (header, encrypted key, IV, ciphertext, authentication tag). Its payload cannot be read without the decryption key.
  • An empty third segment means an unsecured token with alg: none. Servers should reject these.
  • Size matters. Every claim adds bytes to every request. Large tokens can exceed header size limits on proxies or the roughly 4 KB limit for a single cookie, so keep payloads lean.

Parsing runs as you type, entirely in your browser, and the token is never sent to a server.

Frequently asked questions

What is the difference between the parser and the decoder?

Both read the header and payload. The parser updates live, highlights each segment in the original string, and explains the signature structure, which is useful for learning and inspecting token layout.

Why does the signature not decode to readable text?

The signature is raw cryptographic bytes, not JSON. It only has meaning when checked against a key.

What does a token with five parts mean?

It is an encrypted JWE. Its contents cannot be decoded without the recipient's decryption key.

Does parsing check whether the token is valid?

No. Parsing only shows the structure and decoded contents. Use the JWT Verifier to check the signature, and validate claims like exp on your server.