JWT Decoder Tool
Advanced JSON Web Token (JWT) decoder. Parse headers, payload claims, analyze expiration dates, and verify signature algorithms instantly.
JWT Decoder & Analyzer
What is a JWT?
JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA.
JWTs are heavily used in modern web applications, particularly in single-page applications (SPAs) and stateless architectures, for authentication and information exchange.
JWT Structure
A JSON Web Token consists of three parts separated by dots (.):
- Header: Contains metadata about the type of token and the cryptographic algorithms used to secure its contents.
- Payload (Claims): Contains the statements (claims) about an entity (typically, the user) and additional data.
- Signature: Used to verify that the sender of the JWT is who it says it is and to ensure that the message wasn't changed along the way.
When combined, these three parts typically look like this: xxxxx.yyyyy.zzzzz
1. The Header
The header typically consists of two parts: the type of the token, which is JWT, and the signing algorithm being used, such as HMAC SHA256 or RSA.
Example Header JSON:
{
"alg": "HS256",
"typ": "JWT"
}
This JSON is then Base64Url encoded to form the first part of the JWT.
2. The Payload
The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) and additional data. There are three types of claims: registered, public, and private claims.
Registered claims: These are a set of predefined claims which are not mandatory but recommended, to provide a set of useful, interoperable claims. Some of them are:
iss(Issuer): Who issued the token.exp(Expiration time): When the token expires.sub(Subject): Whom the token refers to.aud(Audience): Who the token is intended for.iat(Issued at): When the token was created.nbf(Not before): When the token becomes valid.
Public claims: These can be defined at will by those using JWTs. But to avoid collisions, they should be defined in the IANA JSON Web Token Registry or be defined as a URI that contains a collision-resistant namespace.
Private claims: These are the custom claims created to share information between parties that agree on using them and are neither registered or public claims.
Example Payload JSON:
{
"sub": "1234567890",
"name": "John Doe",
"admin": true,
"exp": 1735689600
}
The payload is then Base64Url encoded to form the second part of the JWT.
Note that for signed tokens this information, though protected against tampering, is readable by anyone. Do not put secret information in the payload or header elements of a JWT unless it is encrypted.
3. The Signature
To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that.
For example, if you want to use the HMAC SHA256 algorithm, the signature will be created in this way:
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
secret
)
The signature is used to verify the message wasn't changed along the way, and, in the case of tokens signed with a private key, it can also verify that the sender of the JWT is who it says it is.
How JWT Authentication Works
- User Login: The user provides credentials (e.g., username and password) to the authentication server.
- Token Generation: If the credentials are valid, the server creates a JWT, signs it with a secret key, and sends it back to the client.
- Token Storage: The client stores the JWT (usually in
localStorage,sessionStorage, or anHttpOnlycookie). - Subsequent Requests: For every subsequent API request to a protected route, the client includes the JWT in the
Authorizationheader using the Bearer schema:Authorization: Bearer <token>. - Token Verification: The server intercepts the request, verifies the JWT's signature and expiration. If valid, it grants access to the requested resources.
JWT Security Best Practices
When implementing JWTs, consider the following security best practices:
- Always Verify the Signature: Ensure your application validates the token's signature on the server-side before trusting the payload.
- Do Not Store Sensitive Data: The payload is only Base64Url encoded, not encrypted. Anyone who intercepts the token can read it. Never store passwords, Social Security numbers, or API keys in a JWT payload.
- Keep Tokens Short-Lived: Use the
expclaim to limit a token's lifespan. Short expiration times (e.g., 15 minutes) minimize the window of opportunity if a token is compromised. - Use Refresh Tokens: For long-lasting sessions, use short-lived access tokens (JWTs) paired with long-lived refresh tokens (opaque strings).
- Enforce Strong Algorithms: Do not allow the
nonealgorithm. Use strong algorithms likeRS256(asymmetric) orHS256(symmetric with a strong, long secret key). - Validate
issandaudClaims: Ensure the token was issued by your trusted server and is intended for the specific application consuming it.
Common JWT Algorithms
Our tool detects the signing algorithm specified in the header. The most common algorithms are:
- HS256 (HMAC with SHA-256): Symmetric algorithm. Both the issuer and verifier share the same secret key.
- RS256 (RSA Signature with SHA-256): Asymmetric algorithm. The issuer uses a private key to sign the token, and the verifier uses a public key to verify it.
- ES256 (ECDSA using P-256 and SHA-256): Asymmetric algorithm similar to RSA but faster and uses smaller keys.
JWT Expiration and Timestamps
JWT uses Unix epoch time (the number of seconds that have elapsed since January 1, 1970) for its time-based claims:
exp(Expiration Time): The time after which the token must not be accepted.iat(Issued At): The time at which the token was issued.nbf(Not Before): The time before which the token must not be accepted.
Our JWT Decoder automatically parses these numeric values into human-readable local dates and clearly indicates if a token is currently active, expired, or not yet valid.
How to Use JWT Decoder Tool
Locate your JWT string. It should look like three blocks of random text separated by dots.
Paste the entire token into the 'Encoded JWT' input area.
The tool will instantly parse and decode the token without hitting any servers.
Review the 'Header' section to see the token type and cryptographic algorithm.
Inspect the 'Payload' section to view the claims and user data embedded in the token.
Check the 'Expiration & Timeline' panel to see human-readable dates for when the token was issued and when it expires.
Use the copy buttons to extract specific JSON blocks or the entire token.
Real Examples
Standard User Authentication JWT
A common token containing user ID, roles, and standard timestamps.
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImV4cCI6MjUzNDA1MDAwMCwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cHeader: { "alg": "HS256", "typ": "JWT" }
Payload: { "sub": "1234567890", "name": "John Doe", "admin": true, "exp": 2534050000, "iat": 1516239022 }Frequently Asked Questions
What is a JWT?
Is it safe to decode a JWT online?
Can I edit the JWT and use it?
Why can anyone read the JWT payload?
What happens if a token is expired?
What is the 'none' algorithm?
What does 'Base64Url encoded' mean?
How do I verify the signature?
What is the difference between JWT and sessions?
How do I check JWT expiration?
Key Features
- Instant real-time parsing of JWT Header and Payload
- Automatic Base64Url decoding and JSON syntax highlighting
- Detailed timeline analysis for exp, iat, and nbf claims
- Visual status indicators for token expiration and validity
- Algorithm detection (HS256, RS256, ES256, etc.)
- Security analysis for 'none' algorithm and missing expirations
- Structure analysis displaying segment sizes and boundaries
- One-click copy and download functionalities for headers, payloads, and tokens
- 100% secure client-side execution—your tokens never leave the browser
Common Use Cases
- Debugging authentication flows in frontend single-page applications (React, Angular, Vue)
- Inspecting claims granted by an OAuth 2.0 or OpenID Connect identity provider
- Verifying that backend services are issuing tokens with the correct expiration dates
- Investigating 'Token Expired' or 'Invalid Signature' errors during API integration
- Learning and teaching how JSON Web Tokens are structured and encoded
- Checking custom private claims injected by backend authorization middleware