What is inside a JWT
A JSON Web Token (RFC 7519) is three parts separated by dots: header.payload.signature. The header and payload are JSON written as URL-safe Base64, which is an encoding anyone can reverse, not encryption. The signature is binary data, also written as Base64.
- Header: how the token is signed.
algis the algorithm, such as HS256 or RS256, andtypis usuallyJWT. - Payload: the claims. Registered ones include
iss(issuer),sub(subject),aud(audience),exp(expiry),nbf(not before),iat(issued at) andjti(token ID). Apps add their own, such as a role or an email address. - Signature: a code computed from the header and payload with a secret or a private key. It is what lets a server detect tampering.
Because the payload is only encoded, anyone who holds the token can read it. Never put passwords or other secrets in a JWT payload.
Decoding is not verifying
Reading a token and trusting a token are different things. Anyone can write a header and a payload that decode perfectly, with any claims they like. The only thing that separates a genuine token from a forged one is the signature, checked with the right key.
This page decodes without checking the signature unless you type a secret, so a decoded token here proves nothing about where it came from. A server that accepts tokens has to:
- verify the signature with its own key, and choose the algorithm itself instead of reading it from the token. Libraries that trusted the token's
algvalue have accepted forged tokens, including ones withalgset tonone; - check
expandnbfagainst the current time, allowing a little clock difference; - check that
issandaudare what it expects.
Use a decoder to understand a token while debugging. Do not use one to decide who may do what.
Reading exp, nbf and iat
These three claims are a number of seconds since 1 January 1970 UTC. A value such as 1791291600 is an absolute moment, so it is the same instant everywhere. The tool shows it in UTC and in your own time zone, and how far away it is.
- A token is expired once the current time is at or after
exp. - A token is not yet usable while the current time is before
nbf. - A 13 digit number is almost always milliseconds, which JWT does not use. The tool warns when it sees one.
If a token looks expired but should not be, compare the dates here with the clock of the machine that checks it. A few minutes of drift between servers is a common cause.
Checking an HS256 signature here
HS256, HS384 and HS512 sign with a shared secret. The signature is an HMAC of the exact text header.payload, with that secret as the key. To check one, type the secret. The page recomputes the HMAC with the browser's Web Crypto and compares it with the signature in the token.
A match means this secret signed this exact header and payload. It does not mean the claims are acceptable, because it says nothing about exp, iss or aud. A mismatch means the secret is wrong or the token was changed after signing. If your secret is stored as Base64, switch on the Base64 option.
Algorithms such as RS256 and ES256 use a private key to sign and a public key to verify, and this page does not take keys. It shows their header and payload and says plainly that the signature was not checked.