Free tool · technology
JWT Decoder
Read the header and payload of a JSON web token. Signatures are not verified.
Your input
Result
Your result appears here.
Runs in your browser · Nothing is uploaded
Embed this on your site
Free to embed. The attribution link stays with the widget, and the calculator keeps working exactly as it does here.
<iframe src="https://thedigitalstash.net/embed/jwt-decoder" title="The Digital Stash calculator" width="100%" height="720" style="border:0;max-width:100%" loading="lazy"></iframe>
Understanding the JWT Decoder
A JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. It is commonly used in web development for authentication and information exchange. This tool decodes the header and payload sections of a JWT to allow developers to inspect their contents.
The decoding method
A JWT consists of three parts separated by dots: the header, the payload, and the signature. This tool focuses exclusively on the first two parts.
The header and payload are encoded using Base64URL. Unlike encryption, this is a reversible encoding scheme. The decoding process involves three steps:
- Splitting the string at each period character to isolate the three segments.
- Replacing URL-safe characters (hyphens and underscores) with standard Base64 characters (plus signs and forward slashes).
- Padding the string with equals signs so that the length is a multiple of four, then decoding the string from Base64 to a standard JSON object.
This tool does not perform cryptographic verification. It simply makes the encoded information legible for the user.
A worked example
Consider a hypothetical token string:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Step 1: Splitting The string is divided into three parts:
- Header:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 - Payload:
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ - Signature:
SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Step 2: Decoding the Header
Decoding the first segment yields the JSON object:
{"alg": "HS256", "typ": "JWT"}
This indicates that the algorithm used is HMAC SHA256 and the type of token is JWT.
Step 3: Decoding the Payload
Decoding the second segment yields the JSON object:
{"sub": "1234567890", "name": "John Doe", "iat": 1516239022}
This shows the subject ID, the name of the user, and the time the token was issued (in Unix timestamp format).
Interpreting the result
Once decoded, the JSON displays key-value pairs.
- The Header typically contains metadata about the token, such as the algorithm used for signing and the token type.
- The Payload contains claims. These are statements about an entity (typically the user) and additional data. Common claims include the subject (sub), the expiration time (exp), and the issuer (iss).
The values are presented as raw JSON. You should ensure your application logic is prepared to parse these specific keys and handle the data types as expected.
Assumptions and limitations
The primary assumption of this tool is that the input provided is a valid JWT string. If the structure does not follow the three-part dot-separated format, the decoding will fail.
It is critical to understand that this tool does not check the signature. In a production environment, verifying the signature is mandatory to ensure the token has not been tampered with and that it was issued by a trusted party. Because this tool ignores the signature, it cannot tell you if a token is authentic, expired, or compromised. It only tells you what information is currently encoded inside the string.
Furthermore, Base64URL encoding is not a security feature. Any information placed in the payload is visible to anyone who possesses the token. Never store sensitive information like passwords, API keys, or personal identification numbers in the payload of a JWT.
Who this tool is not for
This tool is not suitable for security auditing or forensic analysis. If you are attempting to determine if a token is valid, safe, or has been altered by a malicious actor, you must use a dedicated cryptographic library or a secure backend environment that performs full signature verification.
Additionally, this tool is not for users who expect privacy regarding their tokens. Since the tool processes the input in a web browser, avoid pasting tokens that contain sensitive production data into this decoder if you are concerned about data leakage or accidental retention of that data in your browser history or developer tools. It is intended for developers who are debugging their own locally generated or test tokens during the development lifecycle.
More tools like this
Add Line Numbers
Number every line in a list, with aligned columns for code and checklists.
Run itAge Calculator
Exact age in years, months and days, plus days until the next birthday.
Run itAnagram Checker
Check whether two words or phrases use exactly the same letters.
Run it