What Is a JWT? How to Read a JSON Web Token Safely
A JSON Web Token, or JWT, is a compact string that apps use to carry identity information between a client and a server. You will often see one after logging in to a website or calling an API. It looks like random text, but it is easy to read once you know its structure.
The three parts
A JWT has three parts separated by dots: header.payload.signature. The header says which algorithm was used, the payload holds the claims, and the signature lets the server check that the token was not changed.
The header and payload are Base64URL-encoded JSON. That means anyone who has the token can read them. Encoding is not encryption, so never put secrets in a JWT payload.
Common claims
Claims are the facts stored in the payload. Some have standard names.
- sub: the subject, usually a user ID
- iss: the issuer that created the token
- aud: the audience the token is meant for
- exp: the expiry time, as a Unix timestamp
- iat: when the token was issued
- nbf: the time before which the token must not be accepted
Decoding is not verifying
Decoding only reads the contents. Verifying checks the signature with the right key and confirms that the token is valid. A decoder in your browser cannot verify a token without your secret or public key, and your own server must always verify tokens before trusting them.
Check expiry quickly
Many login bugs come from an expired token. The exp claim is a Unix timestamp, so converting it to a date shows when the token stopped working. The JWT Decoder shows the expiry status for you.
Handle real tokens with care
A live token can grant access to an account. Prefer test tokens when debugging, and avoid pasting production tokens into websites you do not trust. ToolWorkIt decodes tokens in your browser and does not send them anywhere.

