JWT Decoder

What claims and expiration does this JWT token contain?

Decode and inspect JWT tokens to view their structure, claims, and expiration times. Essential for debugging authentication flows and validating token contents.

Updated June 2026 · How this works

Example calculation — edit any field to use your own numbers

Worth knowing
How It Works
The formula, explained simply

Think of a JWT token like a tamper-evident envelope containing a letter. The envelope has a clear window showing the delivery method (the algorithm), the letter inside contains your message (the claims), and a special seal proves nobody opened it along the way (the signature). Unlike regular envelopes, anyone can read the contents through the window, but only someone with the secret key can create or verify the authentic seal.

JWT tokens consist of three Base64URL-encoded sections separated by dots: header.payload.signature. The header specifies which cryptographic algorithm signs the token, typically HMAC SHA-256 for symmetric keys or RSA SHA-256 for asymmetric keys. The payload contains claims about the user or system, including standard fields like subject, expiration time, and issued-at timestamp, plus any custom data your application needs.

The signature prevents tampering by combining the header and payload with a secret key using the specified algorithm. When a service receives a JWT, it recalculates this signature and compares it to the provided one. If they match, the token hasn't been modified since creation. This mathematical proof of integrity lets services trust the token contents without querying a central database.

When To Use This
Right tool, right situation

Use JWT decoders when debugging authentication failures, investigating unexpected user permissions, or inspecting tokens during development and testing. They're essential for understanding why API calls return authentication errors, checking if tokens contain expected user claims, or verifying that token generation produces the correct algorithm and expiration settings.

Avoid using JWT decoders with production tokens containing real user data unless the decoder runs entirely locally without network transmission. Never decode tokens on shared computers or untrusted networks where the token contents might be logged or intercepted. JWT decoders are inappropriate for token validation in production systems - always use proper cryptographic libraries that verify signatures rather than just displaying decoded contents.

JWT decoders become particularly valuable during integration testing when connecting services that exchange tokens, helping identify mismatched algorithms, incorrect claim formats, or timing issues with token expiration. They're also useful for educational purposes when learning how JWT authentication works, but remember that decoding alone doesn't prove token authenticity.

Common Mistakes
Why results sometimes look wrong

The most dangerous mistake is trusting JWT contents without verifying the signature, treating tokens like simple Base64-encoded data instead of cryptographically protected messages. This happens when developers decode the payload for display purposes and forget that malicious users can easily modify the visible claims. Without signature verification, an attacker can change user IDs, extend expiration times, or add administrative privileges.

Another common error is storing sensitive data in JWT payloads, forgetting that Base64 encoding provides no encryption or privacy protection. Social security numbers, passwords, or private user details become visible to anyone who decodes the token. JWTs are designed for claims and metadata, not confidential information that should remain server-side.

Developers frequently mishandle token expiration by either ignoring the 'exp' claim entirely or setting expiration times too far in the future for security, or too short for user experience. Some applications also fail to include proper timestamp validation, accepting tokens with future 'iat' (issued at) times or missing 'nbf' (not before) checks, creating windows for replay attacks and token misuse.

The Math
Worked examples and deeper derivation

JWT encoding uses Base64URL, a URL-safe variant of Base64 that replaces + with - and / with _ while removing padding characters. Each section encodes JSON data as UTF-8 bytes, then converts those bytes to Base64URL. The signature calculation depends on the algorithm: HMAC algorithms like HS256 use a shared secret key, while RSA algorithms like RS256 use public-key cryptography with separate signing and verification keys.

Timestamp claims like 'exp' (expiration) and 'iat' (issued at) use Unix time format - seconds since January 1, 1970 UTC. This standardized format ensures tokens work across systems with different time zones and date formats. The signature verification involves recreating the signing input by concatenating the Base64URL-encoded header, a dot, and the Base64URL-encoded payload, then applying the cryptographic algorithm with the appropriate key.

The mathematical security relies on the computational difficulty of forging signatures without the secret key. HMAC provides message authentication using hash functions, while RSA signatures use the mathematical properties of large prime numbers. Both approaches make it computationally infeasible for attackers to create valid signatures for modified token contents.

Debugging failed API authentication
JWT token from failed request: eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ1c2VyMTIzIiwiZXhwIjoxNjQwOTk1MjAwfQ.signature
Token shows RS256 algorithm and expiration of Jan 1, 2022. The expired status explains why your API calls are being rejected with 401 errors.
Validating service-to-service token
Internal API token with no expiration and service account subject
Token shows HS256 algorithm with subject 'service-account-prod' and no expiration date. This confirms it's a long-lived service token, not a user session token.
Mobile app token inspection
User authentication token from mobile app login flow
Token contains user ID in subject field and shows expiration in 24 hours. The issued-at timestamp confirms it was created during the current login session.
Expert Unlock
The thing most explanations skip

JWTs trade database lookups for computational overhead and larger request sizes, making them ideal for stateless systems but problematic for applications requiring immediate token revocation. The signature verification cost scales with token frequency, and longer tokens increase network overhead compared to opaque session IDs.

How do I decode JWT tokens safely?

What information can I see in a JWT token?
JWT tokens contain three sections: header with algorithm type, payload with user claims and timestamps, and signature for verification. The header typically shows the signing algorithm like HS256 or RS256. The payload contains user data like subject ID, expiration time, and custom claims your application added.
Is it safe to decode JWT tokens online?
This decoder runs entirely in your browser without sending data to external servers, making it safe for sensitive tokens. However, never paste production tokens containing real user data into online tools that might transmit your data. Always verify that JWT decoders process tokens locally before using them with sensitive information.
Why does my JWT token show as expired?
JWT tokens include an 'exp' claim that sets an expiration timestamp in Unix time format. When the current time exceeds this timestamp, the token becomes invalid and authentication systems will reject it. Most applications set token lifetimes between 15 minutes and 24 hours depending on security requirements and user experience needs.

Need something this doesn't cover?

Suggest a tool — we'll build it →