JWT Decoder
Decode JSON Web Token headers and payloads locally, see iat, nbf and exp as dates, and verify HS256, HS384 and HS512 signatures.
- Free
- No sign-up
- Runs in your browser
JWT Decoder
Your token and secret stay in this browser tab. They are not sent, stored or added to the URL.
Decoded, NOT verified. Anyone can create a token with these contents. Trust it only after its signature has been checked with the right key.
| Claim | When (UTC, then local) |
|---|
Check the signature
Runs in your browser. Your inputs never leave your device.
In short
Quick Answer
A JWT is three Base64URL-encoded parts separated by dots: a header, a payload of claims, and a signature. Decoding the first two parts shows their JSON, but it does not prove the token is genuine; only checking the signature with the right key does. This decoder runs entirely in your browser and can verify HS256, HS384 and HS512 signatures with a secret you type.
Step by step
How to Use
- Paste the token. Paste the JWT, with or without a 'Bearer ' prefix.
- Read the header and payload. See both parts as formatted JSON and the time claims as UTC and local dates.
- Check expiry. The status shows whether the token has expired or is not valid yet.
- Verify the signature (HS256/384/512). Type the shared secret and press Verify to check the signature locally.
Common JWT Claims
| Claim | Name | Meaning |
|---|---|---|
iss | Issuer | Who created and signed the token |
sub | Subject | Who the token is about, often a user ID |
aud | Audience | Which service the token is meant for |
exp | Expiration time | After this time the token must be rejected |
nbf | Not before | Before this time the token must be rejected |
iat | Issued at | When the token was created |
jti | JWT ID | A unique ID, used to stop a token being replayed |
Decoding Is Not Verifying
The header and payload of a signed JWT are only encoded, so they can be read by anyone and changed by anyone. What stops tampering is the signature: if a single character of the header or payload changes, the signature no longer matches. A server must therefore:
- Verify the signature with the expected key and an allow-list of algorithms, never the algorithm named in the token alone.
- Check the times: reject tokens past
expor beforenbf, allowing only a small clock skew. - Check who it is for:
issandaudmust match your issuer and service. - Keep tokens short-lived and send them only over HTTPS, as RFC 8725 recommends.
This page is for reading and debugging tokens. HMAC signatures are checked with the browser's Web Crypto API, and the token and secret are kept only in memory while the page is open. For generating random secrets, see the password generator; for hashing text, the hash generator.
The math
How a JWT Is Decoded and Verified
JWT = Base64URL(header) . Base64URL(payload) . Base64URL(signature) · HS256 signature = HMAC-SHA256(secret, header + '.' + payload)
Each part uses Base64URL encoding (RFC 4648), which swaps + and / for - and _ and drops = padding. Decoding the header and payload gives UTF-8 JSON. The time claims iat (issued at), nbf (not before) and exp (expires) are NumericDate values: seconds since 1970-01-01T00:00:00Z, shown here as UTC and local dates. For HMAC algorithms, the signature is recomputed over the exact header and payload text with the secret, using the browser's Web Crypto API, and compared in constant time. Tokens signed with RS256, ES256 or other public-key algorithms need the issuer's public key and are not verified here.
- Header: Metadata such as alg (the signing algorithm) and typ (usually JWT).
- Payload: The claims: who the token is about (sub), who issued it (iss), the audience (aud), times and any custom data.
- Signature: Proof that the header and payload were created by someone holding the key and were not changed.
Examples
Worked Examples
The jwt.io example token
Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
- Header: {"alg": "HS256", "typ": "JWT"}
- Payload: {"sub": "1234567890", "name": "John Doe", "iat": 1516239022}
- iat 1516239022 = 2018-01-18T01:30:22Z; there is no exp claim
Result: Decoded; with the secret your-256-bit-secret the HS256 signature is valid
A token with only two parts
Token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIn0
- Splitting on dots gives 2 parts instead of 3
Result: Error: the signature part is missing
An expired token
Payload contains exp: 1700000000
- 1700000000 = 2023-11-14T22:13:20Z, which is in the past
Result: Marked as expired; a server checking exp would reject it
Watch out
Common Mistakes to Avoid
- Trusting a decoded token: Anyone can create a token with any payload. Decoding only reads it. Your server must verify the signature with the correct key and algorithm, and check exp, nbf, iss and aud, before trusting any claim.
- Putting secrets in the payload: A signed JWT is encoded, not encrypted: anyone who has the token can read the payload. Never put passwords, card numbers or other secrets in it.
- Accepting alg: none or switching algorithms: Libraries must only accept the algorithms you expect. Allowing 'none', or letting an attacker switch from RS256 to HS256, are classic JWT vulnerabilities listed by OWASP.
- Pasting production tokens into websites: A valid token is a password for as long as it lasts. Only paste tokens into tools that run locally, like this one, and prefer expired or test tokens.
- Using a weak HMAC secret: HS256 secrets such as 'secret' can be guessed offline from any token. Use a long random key, at least 256 bits for HS256, as RFC 7518 requires.
FAQ
Frequently Asked Questions
How do I decode a JWT?
Paste the token into the box. The header and payload are Base64URL-decoded and shown as formatted JSON, with time claims converted to dates.
Is it safe to paste my JWT here?
Decoding and signature checks run in your browser. The token and secret are not sent anywhere, stored, logged or added to the page address. Even so, avoid pasting live production tokens into any website you do not control.
Does decoding a JWT verify it?
No. Decoding only reads the contents. A token is trustworthy only after its signature has been verified with the right key, and its expiry and audience have been checked.
How do I check if a JWT is expired?
Look at the exp claim: it is a Unix timestamp in seconds. If it is earlier than the current time, the token has expired. The decoder shows exp as a date and marks expired tokens.
How do I verify an HS256 JWT signature?
Enter the shared secret in the signature section and press Verify. The HMAC is recomputed locally with Web Crypto. For the jwt.io example token the secret is your-256-bit-secret.
Can I verify RS256 or ES256 tokens here?
Not at the moment. Those use public-key signatures and need the issuer's public key (often from a JWKS URL). Verify them in your application with a maintained JWT library.
What is the difference between JWT, JWS and JWE?
A JWT is a set of claims. When signed it is a JWS (three parts) and its payload is readable; when encrypted it is a JWE (five parts) and the payload can only be read with the decryption key.
What do iat, nbf and exp mean?
iat is when the token was issued, nbf is the earliest time it may be used, and exp is when it expires. All three are seconds since 1 January 1970 UTC.
References