About this tool
A JSON Web Token (JWT) is a compact, signed token that carries claims about a user or a session, such as who they are and when the token expires. APIs receive them in the Authorization: Bearer … header, and identity providers like Auth0, Firebase, Supabase, Cognito, Clerk and Keycloak issue them. This JWT decoder shows what’s inside a token in plain language, and checks the signature for HMAC-signed tokens. Everything happens in your browser.
How to decode a JWT
- Paste the token into the box above (with or without the
Bearerprefix). Click Load example if you just want to try it. - Read the header (algorithm and key ID) and the payload (the claims), shown as formatted JSON.
- Check Time claims:
exp,iatandnbfare converted to real dates with a clear expired / not-yet-valid / valid status. - To verify an HS256, HS384 or HS512 token, enter the secret. The verdict updates as you type.
JWT structure
A JWT has three Base64URL-encoded parts separated by dots: a header, a payload of claims, and a signature. The signature is computed over the first two parts, so changing a single character in the header or payload makes it invalid.
Decoding needs no key. Base64URL is an encoding, not encryption: anyone holding a token can read its payload. Never put passwords, API keys or personal data you wouldn’t show the user into a JWT. (Encrypted tokens, called JWE, have five parts instead of three.)
Standard JWT claims
| Claim | Name | Meaning |
|---|---|---|
iss | Issuer | Who created the token, e.g. your auth server’s URL |
sub | Subject | Who the token is about, usually the user ID |
aud | Audience | Which API or app the token is meant for |
exp | Expiration | Unix time (in seconds) after which the token must be rejected |
nbf | Not before | Unix time before which the token isn’t valid yet |
iat | Issued at | Unix time when the token was created |
jti | JWT ID | A unique ID, useful for revocation lists and preventing replays |
The header usually contains alg (the signing algorithm), typ (JWT) and often kid, the ID of the key used to sign it. Providers add their own claims too, such as email, scope, roles or azp. To convert any Unix timestamp by hand, use the timestamp converter.
JWT signing algorithms
| alg | Type | Verified with |
|---|---|---|
| HS256, HS384, HS512 | HMAC with a shared secret | The same secret that signed it (this tool can verify these) |
| RS256, RS384, RS512 | RSA signature | The issuer’s public key, often published as a JWKS URL |
| PS256, PS384, PS512 | RSA-PSS signature | The issuer’s public key |
| ES256, ES384, ES512 | ECDSA signature | The issuer’s public key |
| EdDSA | Ed25519 signature | The issuer’s public key |
| none | Unsigned | Nothing. Never accept these in production |
Need a secret for HS256? The JWT secret generator creates one with the right length.
Decoding is not verifying
Anyone can create a token with any payload. Your server must verify it before trusting any claim:
- Check the signature with the correct key, and pin the allowed algorithms rather than trusting the token’s own
algheader. - Reject expired tokens (
exp) and tokens that aren’t valid yet (nbf). Allow a small leeway, such as 30–60 seconds, for clock differences between servers. - Check
issandaud, so a token issued for another app can’t be used against yours. - Use a well-maintained library, not hand-written parsing, for verification.
Decode a JWT in code
function decodeJwt(token) {
const [header, payload] = token.split('.').slice(0, 2).map((part) => {
const base64 = part.replace(/-/g, '+').replace(/_/g, '/');
const bytes = Uint8Array.from(atob(base64), (c) => c.charCodeAt(0));
return JSON.parse(new TextDecoder().decode(bytes)); // handles non-ASCII text
});
return { header, payload };
}const [header, payload] = token
.split('.')
.slice(0, 2)
.map((part) => JSON.parse(Buffer.from(part, 'base64url').toString('utf8')));
// Decoding is not verification. To trust the claims, verify instead:
// jwt.verify(token, secret, { algorithms: ['HS256'] }) (jsonwebtoken)import base64, json
def decode_part(part: str) -> dict:
padded = part + "=" * (-len(part) % 4) # JWTs drop Base64 padding
return json.loads(base64.urlsafe_b64decode(padded))
header, payload = (decode_part(p) for p in token.split(".")[:2])
# To trust the claims, verify instead (PyJWT):
# jwt.decode(token, secret, algorithms=["HS256"])Troubleshooting
- “Invalid signature”: the secret is wrong, or its format is. Some systems use the Base64-decoded bytes of the secret as the key, so try switching the secret format. Also check that the token wasn’t cut off when you copied it.
- Token is expired straight away: the server’s clock may be wrong, or
expwas set from the wrong time zone. JWT times are always UTC. - Expiry date tens of thousands of years away:
expwas set in milliseconds (JavaScript’sDate.now()) instead of seconds. Divide by 1000. - “Invalid token” or a parse error: the value isn’t a JWT. Opaque access tokens (random strings) can’t be decoded, only checked with the issuer.
FAQ
How do I decode a JWT token?
Paste it into the decoder above. A JWT is three Base64URL-encoded parts separated by dots; decoding the first two gives the header and payload as JSON. No secret is needed to read them.
Is it safe to paste my token here?
Decoding and verification run locally in your browser, and nothing is sent to a server. Still, treat production tokens like passwords and prefer test tokens.
Can a JWT be decoded without the secret?
Yes. The header and payload are only encoded, not encrypted, so anyone can read them. The secret is needed only to create or verify the signature.
What is the difference between decoding and verifying a JWT?
Decoding just reads the contents. Verifying checks the signature with the correct key, plus claims like exp, iss and aud, which proves the token is genuine and still valid. Always verify on the server.
Why does verification say "invalid signature"?
Either the secret is wrong, or its format is. Some systems use the base64-decoded bytes of the secret as the key. Try switching the secret format.
How do I check if a JWT is expired?
Look at the exp claim, a Unix time in seconds. The decoder converts it to a date and shows whether the token has expired.
Can it verify RS256 or ES256 tokens?
Not yet. Those need the issuer’s public key (JWKS). The header and payload still decode normally.