JWT Decoder
Decode and inspect JSON Web Tokens (JWT).
Overview of jwt-decoder
jwt-decoder is a versatile web tool designed to decode and validate JSON Web Tokens (JWT). JWTs are widely used in web applications for securely transmitting information between parties as a JSON object. This tool simplifies the process of inspecting and understanding the contents of a JWT, making it an invaluable resource for developers, security professionals, and anyone involved in web development. With jwt-decoder, you can easily decode the header, payload, and signature of a JWT, and validate its integrity and expiration, ensuring that the token is authentic and has not been tampered with.
How to Use jwt-decoder
Step-by-Step Guide
- Navigate to the jwt-decoder Website:
-
Open your web browser and go to the official
jwt-decoderwebsite. -
Enter the JWT:
-
Locate the input field where you can paste your JWT. A JWT typically looks like a long string of characters divided into three parts separated by dots (e.g.,
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c). -
Decode the JWT:
-
Click the "Decode" button. The tool will then break down the JWT into its three components: Header, Payload, and Signature.
-
Review the Results:
-
The decoded information will be displayed in a structured format, allowing you to easily inspect the contents of the token. You can view the algorithm used, the expiration time, the subject, and other claims.
-
Validate the JWT:
- If you have the secret key used to sign the token, you can enter it in the provided field and click "Validate" to check the token's integrity and expiration.
Advanced Usage
- Batch Decoding:
-
For multiple JWTs, use the batch decoding feature by pasting multiple tokens separated by new lines or commas.
-
Custom Claims:
-
You can also inspect custom claims within the payload by expanding the JSON output.
-
Token Expiration:
- The tool will highlight if the token has expired, providing a clear indication of the token's validity.
Usage Examples
Example 1: Decoding a JWT
Input:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Output:
{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
},
"signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
Example 2: Validating a JWT with a Secret Key
Input:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Secret Key:
your-secret-key
Output:
Token is valid.
Example 3: Inspecting Custom Claims
Input:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJyb2xlIjpbInVzZXIiLCJhZG1pbiJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Output:
{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022,
"role": ["user", "admin"]
},
"signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
Feature Table
| Feature | Description |
|---|---|
| Token Decoding | Decodes the header, payload, and signature of a JWT for easy inspection. |
| Token Validation | Validates the integrity and expiration of a JWT using a provided secret key. |
| Batch Decoding | Allows decoding of multiple JWTs at once, separated by new lines or commas. |
| Custom Claims Inspection | Displays custom claims within the payload for detailed analysis. |
Overview of jwt-decoder
jwt-decoder is a versatile web tool designed to decode JSON Web Tokens (JWTs) quickly and efficiently. JWTs are a compact, URL-safe means of representing claims to be transferred between two parties. They are widely used in web applications for authentication and authorization processes. However, understanding the contents of a JWT can be challenging without the right tool. jwt-decoder simplifies this process by breaking down the token into its constituent parts: the header, payload, and signature. This tool is invaluable for developers and security professionals who need to inspect and validate JWTs during development, testing, and troubleshooting.
How to Use jwt-decoder
Step-by-Step Guide
- Navigate to the jwt-decoder Website: Open your web browser and go to the official
jwt-decoderwebsite. - Enter the JWT: In the main input field, paste the JWT you want to decode. Ensure the token is in the correct format.
- Click Decode: Click the "Decode" button to process the token.
- View the Results: The tool will display the decoded header, payload, and signature in separate sections. Each section provides a clear and detailed breakdown of the data.
Additional Options
- Verify Signature: If you have the secret key, you can enter it in the "Secret Key" field to verify the token's signature.
- Pretty Print: Use the "Pretty Print" option to format the JSON output for better readability.
- Download: Click the "Download" button to save the decoded token as a JSON file.
Usage Examples
Example 1: Basic Decoding
Input
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Output
{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
},
"signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
Example 2: Signature Verification
Input
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Secret Key
your-256-bit-secret
Output
{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
},
"signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"verified": true
}
Example 3: Pretty Print
Input
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJyb2xlcyI6WyJhZG1pbiJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Output (Pretty Print)
{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022,
"roles": ["admin"]
},
"signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
Feature Table
| Feature | Description |
|---|---|
| Token Decoding | Instantly decodes JWTs into their header, payload, and signature components. |
| Signature Verification | Validates the token's signature using a provided secret key. |
| Pretty Print | Formats the JSON output for enhanced readability. |
| Download Option | Allows users to save the decoded token as a JSON file for record-keeping. |