JWTs are often used for authentication and API authorization, but they are not encrypted containers. Header and Payload can be decoded directly.
xxxxx.yyyyy.zzzzz
header.payload.signatureA JWT usually has three dot-separated parts: Header, Payload, and Signature.
What Do the Three Parts Mean?
| Part | Contains | Encrypted? |
|---|---|---|
| Header segment | Algorithm and token type, such as alg and typ | No |
| Payload segment | Claims such as sub, exp, and role | No |
| Signature segment | A signature calculated with a secret or private key | Used for integrity |
Safety Rules for Inspecting JWTs
- Do not paste real production tokens into untrusted websites.
- Do not store passwords, identity numbers, payment data, or other sensitive values in Payload.
- Being able to read Payload does not mean the token is valid; expiration and signature still matter.
- HS256 verification requires a secret; never expose a production secret to frontend code or third-party pages.
- Browser-local decoding is better than uploading sensitive tokens to a server-based tool.
Common Claims
| Claim | Meaning | What to check |
|---|---|---|
| sub | Subject or user ID | Is it the expected user? |
| exp | Expiration time | Usually a Unix timestamp |
| iat | Issued-at time | Is the token too old? |
| aud | Audience | Is it meant for this service? |
| iss | Issuer | Does it come from the expected authority? |
Decoding and verification are different operations
Decoding only restores the first two Base64URL segments as JSON and requires no key, so an attacker can create a plausible-looking Payload too. Verification must happen on the server with an allowed algorithm and trusted key, followed by checks for exp, nbf, iss, aud, and other claims. A debugging tool showing the fields proves only that the token is readable, not that it deserves trust.
decoded successfully != valid signature
valid signature != authorized request
complete decision = signature + time + issuer + audience + application permissionsImportant server-side verification boundaries
- Configure the allowed algorithms on the server instead of accepting any alg named by the Header.
- exp and nbf normally use Unix seconds, and comparisons may need a small allowance for clock skew.
- Asymmetric algorithms such as RS256 verify with a public key, while HS256 requires every verifier to possess the same secret.
- Token revocation, user suspension, and permission changes do not rewrite an old token automatically, so sessions need a separate policy.
- A signature protects against content modification. It does not hide the Payload or prove that the client device is safe.
For debugging, use a redacted token or inspect Header and Payload locally. Production keys do not belong in browser code, screenshots, support tickets, or third-party pages. When a real signature must be tested, use the same verification library and algorithm allowlist in a controlled backend or local development environment.
Summary
JWT Header and Payload are convenient for debugging, but they are not private. Safe JWT usage depends on signature keys, expiration, and careful claim design.