Home / JWT tools / JWT header decoder

JWT Header Decoder

Paste a token and read its header: the algorithm, token type, key ID and any other field, each with a short explanation.

What is in a JWT header?

The header is the first part of a token, before the first dot. It is a small JSON object that is Base64URL encoded. It tells the receiver how to treat the rest of the token.

Common header fields

  • alg: the signing algorithm, such as HS256, RS256 or ES256. Required.
  • typ: the token type, normally JWT.
  • kid: the key ID, used to pick the right key when several are in rotation.
  • jku, jwk, x5u, x5c: ways to point to or carry the public key or certificate.
  • cty and crit: content type and required extensions.

Why the header matters for security

The header is not protected by trust, only by the signature. A receiver must never accept whatever alg the token names. Keep a fixed list of allowed algorithms, reject none, and do not fetch keys from a URL that the token itself supplies.

Decode or build?

This page reads a header from an existing token. To write a header and get its Base64URL form, use the JWT header builder. For the full token use the JWT decoder, and for the second part see the payload decoder. The JWT guide explains how the parts fit together.

Frequently asked questions

How do I read a JWT header?

Take the text before the first dot, Base64URL decode it and read the JSON. This tool does that for you.

What does the alg field mean?

It names the algorithm used to sign the token, for example HS256 for HMAC with SHA-256 or RS256 for RSA with SHA-256.

What is the kid header?

The key ID. It tells the receiver which key was used, which matters when keys are rotated.

Is the header encrypted?

No. It is only encoded, so anyone who has the token can read it.