What this JWT decoder does
JSON Web Tokens carry identity and permissions between a login server and APIs. A JWT has three Base64URL-encoded parts separated by dots: a header describing the algorithm, a payload of claims, and a signature. This decoder splits the token, pretty-prints the header and payload, converts iat, nbf and exp timestamps to readable dates, and tells you whether the token has expired. Decoding happens in your browser, which matters because tokens grant access to accounts.
How to use it
- Paste the token, typically copied from an
Authorization: Bearer ...header or browser storage. - Read the Header to see the algorithm (
alg) and key ID (kid). - Inspect the Payload claims such as
sub,aud,iss,scopeand custom roles. - Check the banner for expiry status and the date list for issued-at and not-before times.
Practical examples
- "401 Unauthorized" debugging: decode the token your frontend sends and compare
audandisswith what the API expects; mismatches are the most common cause. - Clock skew issues: if
nbfis a few seconds in the future, a server with a slow clock rejects the token as not yet valid. - Checking scopes: confirm that the token actually contains
read:ordersbefore blaming the API's permission logic. - Session length: subtract
iatfromexpto see how long your identity provider issues tokens for.
Tips and edge cases
- Decoding is not verification. Anyone can create a token with any payload; only checking the signature with the right key proves it is genuine.
- Never trust
alg: none. Servers must use an allow-list of expected algorithms. - JWT payloads are readable by anyone who holds the token, so do not put secrets or personal data in them.
- Timestamps are in seconds since the Unix epoch, not milliseconds.
- Encrypted tokens (JWE) have five parts and cannot be decoded without the key.