Skip to content

Three Base64URL segments, one optional HMAC check

Decode a JWT

A JWT is header, payload, and signature, separated by dots. The first two parts are readable JSON. The third part is a signature over those two parts, not a place to hide the claims.

This page Base64URL-decodes the header and the payload and pretty-prints the JSON. exp and iat are Unix seconds and are shown as UTC. If the algorithm is HS256, HS384, or HS512, you can type the same secret the issuer used and the page checks the signature with Web Crypto. RSA and ECDSA algorithms are shown but not verified here, because those need a public key rather than a shared secret. An alg of none is never treated as valid.

The token and the secret stay in this tab. Glazlo does not verify them on a server and does not keep a copy.

This tool runs in your browser. Turn on JavaScript to use it.

A token signed with the secret dev-key

The payload is {"sub":"glazlo","exp":2000000000}. The expiry is 2033-05-18T03:33:20.000Z. The signature checks only when the secret is exactly dev-key.

Token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJnbGF6bG8iLCJleHAiOjIwMDAwMDAwMDB9.-sUSREhmgd1bF8wdBbNi-HBSKYLJi5rxio1a_09l93g
Algorithm
HS256
Secret for the check
dev-key

How to use it

  1. 1Paste the whole token, including both dots.
  2. 2Read the header and payload. Check whether exp is still in the future.
  3. 3If you have the HMAC secret, type it and check the signature. A mismatch means the secret or the bytes differ.

Good to know

  • Decoding does not mean the token is trusted. The signature check is the part that uses the secret.
  • RS256 and ES256 need a key pair. This page will say the algorithm is unsupported for the HMAC check.
  • The clock comparison uses this device's current time against exp.

Questions

Can this recover a secret I forgot?

No. It only checks a secret you already have. It does not search for one.

Why can I read the payload without the secret?

The payload is encoded, not encrypted. Anyone with the token can read the claims. The secret only protects the signature.

What if alg is none?

The page still shows the JSON, and it will not call that token verified. A missing signature is not a pass.

Related tools

  • Base64 encode and decode

    Base64 writes bytes as letters, digits, plus, and slash. It is how a token or a file preview survives a text field. It does not hide the contents from anyone who can read the alphabet.

  • HMAC a message

    HMAC mixes a secret key into the hash so someone who can see the message still cannot forge the tag. Hashing the key and the message yourself, one after the other, is not HMAC.

  • Hash text or a file

    A hash is a fixed-length fingerprint. The same bytes always produce the same digest, and the digest is not a way back to the file. Use it to compare a download or to spot a changed string.