Anatomy of a JWT
A JSON Web Token (RFC 7519) is three Base64URL-encoded parts joined by dots: header.payload.signature. The header names the signing algorithm (for example HS256 or RS256), the payload carries claims, and the signature lets a server confirm that nobody tampered with the first two parts.
Registered claims
| Claim | Meaning |
|---|---|
iss | Issuer |
sub | Subject (usually the user ID) |
aud | Audience the token is meant for |
exp | Expiry time (Unix seconds) |
nbf | Not valid before |
iat | Issued at |
jti | Unique token ID |
Security notes
- Decoding isn't verifying. Anyone can read a JWT payload, so never put secrets in it.
- Always verify the signature and check
exp,audandisson the server with a maintained library. - Reject
alg: none, and pin the algorithms you accept. - Keep access tokens short-lived and use refresh tokens for longer sessions.
- Don't paste production tokens into online tools you don't trust. This one runs only in your browser.