How to Decode and Understand JWTs
A compact signed JWT carries an encoded header, encoded claims and a signature. You can read the first two parts to troubleshoot an integration. A readable payload or future expiration time gives no assurance that the token is genuine.
Read the header and payload
Use the JWT Decoder’s built-in unsigned example or another synthetic token. The header identifies the declared algorithm and may contain a key identifier. The payload contains claims such as sub for the subject, iss for the issuer, and aud for the audience. Claims are values supplied by the issuer. Inspect them alongside the service’s expectations.
JWT header and payload segments use Base64URL. Dots separate segments and padding is typically omitted. A five-part token is commonly an encrypted compact token. A simple decoder cannot recover its claims without decryption.
{"sub":"demo-user","iss":"https://example.com","aud":"inventory-api","exp":1900000000}Interpret expiration and clock differences
JWT NumericDate values are measured in seconds since the Unix epoch. JavaScript Date takes milliseconds, so multiply by 1,000 before converting. At or after exp the token is expired under the JWT expiration rule. A consuming service may apply a small clock tolerance according to its policy.
Inspect nbf when a newly issued token fails because it cannot yet be accepted. The iat claim records issuance time. A missing exp leaves nothing for the decoder to display for that claim, but the consumer can require an expiration under its own contract.
const exp = 1900000000;
console.log(new Date(exp * 1000).toISOString());2030-03-17T17:46:40.000ZVerify where the token is consumed
Use a maintained verification library in the receiving service. Configure the algorithms, trusted keys, issuer and audience that your service accepts. Treat a token’s declared algorithm and claims as untrusted during inspection.
Use test values for debugging. A signed JWT payload is typically readable by anyone who has the token. Keep live bearer tokens out of tickets, screenshots and documentation.
Frequently asked questions
- Does ToolsRivet verify signatures?
- The decoder reports signatureVerified as false. It displays the contents and UTC dates so you can inspect them.
- Why does my expiration date look wrong?
- Check that the issuer supplied seconds, the claim is numeric, and you are comparing dates in the same timezone.