JWT Encoder / Decoder

Easily decode, verify, and encode JSON Web Tokens (JWT) directly from your browser.

Encoded Token
Verify Signature
Used to recalculate and verify the hash.
Decoded Data Status

HEADER: ALGORITHM & TOKEN TYPE

PAYLOAD: DATA

The JWT Encoder / Decoder is an online utility designed to help developers create, inspect, and understand JSON Web Tokens (JWTs). It can help you examine token headers and payloads, review claims, and understand how JWT data is structured.

JSON Web Tokens are commonly used to transmit information between applications and services. Developers often work with JWTs when building authentication systems, APIs, and web applications. This tool makes it easier to inspect token data without manually decoding Base64URL-encoded sections.

Security note: Decoding a JWT does not verify its signature or prove that the token is trustworthy. Avoid entering real access tokens, session tokens, or other sensitive credentials into online tools unless you trust how the tool handles your data.

What Is a JWT Encoder / Decoder?

A JWT Encoder / Decoder works with JSON Web Tokens, a compact format for representing claims that can be transmitted between parties. A typical signed JWT contains three parts separated by periods:

  • Header: Specifies information such as the token type and signing algorithm.
  • Payload: Contains claims, such as an issuer, subject, expiration time, or user-related data.
  • Signature: Helps a receiving system verify that the token has not been altered and was signed using the expected key or secret.

A signed JWT commonly follows this structure:

header.payload.signature

The header and payload are usually JSON data encoded using Base64URL. This encoding is not encryption, so anyone who obtains a typical signed JWT can often read its header and payload.

How to Decode a JWT Token Online

Follow these steps to inspect an existing token:

  1. Open the JWT Encoder / Decoder tool.
  2. Paste the JWT into the decoder input field.
  3. Run the decoding operation.
  4. Review the decoded header and payload.
  5. Check important claims, including the issuer, audience, and expiration time, when present.

A valid token usually contains three dot-separated sections if it is a standard signed JWT. Malformed input, unsupported token formats, or incorrectly encoded data may cause decoding errors.

Decoding only reveals the token's readable structure. It does not confirm that the signature is valid or that the token should be accepted by an application.

How to Encode a JWT

Creating a JWT generally involves preparing a JSON header and payload, encoding their contents, and signing the token when required.

A typical workflow includes:

  1. Prepare a JSON header containing the appropriate token type and signing algorithm.
  2. Create a payload containing the required claims.
  3. Encode the header and payload using Base64URL encoding.
  4. Sign the encoded data using the required algorithm and key, if producing a signed JWT.
  5. Verify the resulting token using the appropriate verification process.

The exact steps depend on the tool's supported features. Encoding JSON into Base64URL is not the same as creating a secure, signed JWT. If the tool supports signing, use the correct algorithm and protect any signing secret or private key.

JWT Decoding Example

Consider this simplified JWT header:

{
  "alg": "HS256",
  "typ": "JWT"
}

This header indicates that the token declares the HS256 signing algorithm and the JWT type.

A sample payload might look like this:

{
  "sub": "user123",
  "role": "member",
  "exp": 1893456000
}

In this example:

  • sub identifies the subject represented by the token.
  • role is an application-specific claim.
  • exp represents the expiration time as a Unix timestamp.

These values are illustrative, not a real authenticated token. The presence of a claim does not prove that it is accurate or trusted. Applications must validate the signature and relevant claims before relying on them.

Common JWT Claims Explained

JWT claims carry information about the token or the entity it represents. Common registered claims include:

ClaimMeaning
iss | Identifies the issuer of the token
sub | Identifies the subject
aud | Identifies the intended audience
exp | Specifies the expiration time
nbf | Specifies the time before which the token must not be accepted
iat | Indicates when the token was issued
jti | Provides a unique identifier for the token

Applications may also use custom claims, such as a role or permission. These claims should be interpreted according to the application's rules rather than trusted solely because they appear in a decoded payload.

JWT Encoder vs. JWT Decoder

Although encoding and decoding are related, they perform different tasks.

FeatureJWT EncoderJWT Decoder
Main purpose | Creates token components or JWTs | Reads token components
Input | JSON header and payload, and signing information when needed | An existing JWT
Output | Encoded token or token components | Readable header and payload
Common use | Development and testing | Debugging and token inspection
Security requirement | Signing keys must be handled securely | Decoding alone does not verify authenticity

A decoder is useful for troubleshooting token contents. An encoder can assist with development, but a production application should use a trusted JWT library and follow the relevant security requirements.

Common JWT Errors and How to Fix Them

Invalid token format: Check that the token has the expected structure and that no characters were accidentally removed.

Malformed JSON: If you are encoding a token, make sure the header and payload contain valid JSON.

Invalid signature: Confirm that the verification key, signing algorithm, and token have not been changed. Do not accept a token merely because its payload decodes successfully.

Expired token: Check the exp claim and your application's expiration-handling logic.

Incorrect audience or issuer: Verify that the token's aud and iss claims match the values expected by the receiving application.

Unsupported algorithm: Ensure your application explicitly permits the algorithm used by the token and rejects unexpected algorithms.

JWT Security Best Practices

JWTs are often used in authentication systems, so handling them carefully is important.

  • Never share signing secrets or private keys in public tools, source code, or messages.
  • Avoid putting passwords, API keys, or other confidential information in readable JWT payloads.
  • Validate the signature before trusting token claims.
  • Check expiration, issuer, audience, and other required claims.
  • Use established JWT libraries for production authentication rather than implementing cryptographic operations from scratch.
  • Use HTTPS when transmitting tokens.
  • Keep access tokens private and revoke or rotate credentials when exposure is suspected.

A signed JWT provides integrity protection when correctly validated, but it does not automatically encrypt its contents. Encrypted JWTs use a different structure and require appropriate decryption support.

Frequently Asked Questions

What is a JWT encoder and decoder?

A JWT encoder creates encoded token components or a JWT, while a decoder reads the token's structure and displays its header and payload. Available features depend on the tool.

Can I decode a JWT without a secret key?

Yes. The header and payload of a typical signed JWT can be decoded without a secret key. However, a secret or public key may be required to verify its signature, depending on the signing algorithm.

Does decoding a JWT verify the token?

No. Decoding reveals the contents of the encoded sections but does not establish that the signature is valid or that the claims should be trusted.

Is a JWT encrypted?

Not necessarily. A typical signed JWT has a readable header and payload. Encryption is a separate feature used when confidentiality is required.

Is it safe to paste a JWT into an online decoder?

Only if you trust the tool and understand how it handles the data. JWTs may contain active credentials or sensitive information, so use a test token or a trusted local tool whenever possible.

Can a JWT contain an expiration date?

Yes. The registered exp claim can specify when a token expires. An application must check this claim during token validation.

Decode and Inspect JWTs Online

Use the JWT Encoder / Decoder to inspect token structure, review claims, and troubleshoot JWT-related development issues. For production authentication, always validate signatures and required claims with a trusted implementation before accepting a token.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us