How to Debug JWTs Without Exposing Your Tokens
JWT tokens contain sensitive data. Learn how to decode and inspect them safely without pasting into online tools.
JWT (JSON Web Tokens) are everywhere — authentication, authorization, API communication. Debugging them is a daily task. But pasting tokens into jwt.io means sending your auth data to a third-party server.
What's Inside a JWT
A JWT has three parts separated by dots:
- Header — algorithm and token type
- Payload — claims (user ID, roles, expiration)
- Signature — verification hash
The header and payload are just Base64-encoded JSON. Anyone can decode them. That's by design — JWTs aren't encrypted, they're signed.
Why Online JWT Debuggers Are Risky
When you paste a token into jwt.io or similar:
- The full token (including signature) is sent to their server
- The payload may contain user IDs, email addresses, or permissions
- If the token is still valid, someone could theoretically use it
- Corporate security policies often prohibit this
Safe Local Debugging
DevKitHub's JWT Debugger decodes tokens entirely on your machine:
- Decode header and payload instantly
- View expiration time in human-readable format
- Validate signature with your secret key (locally)
- Check if token is expired
No network requests. No data leaves your device.
JWT Best Practices
- Keep payloads small — only include what you need
- Set short expiration times — 15-60 minutes for access tokens
- Use refresh tokens — longer-lived, stored securely
- Never store sensitive data in the payload — it's readable by anyone
- Validate on every request — don't trust the client