toolqik

78 · Encode & Convert

JWT Decoder

Decode tokens, read claims, check expiry and verify HS signatures.

Runs in your browser
Header

  
Payload

  

Verify signature (HS256 / HS384 / HS512)

Secret format

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

  1. Paste the token into the box above (with or without the Bearer prefix). Click Load example if you just want to try it.
  2. Read the header (algorithm and key ID) and the payload (the claims), shown as formatted JSON.
  3. Check Time claims: exp, iat and nbf are converted to real dates with a clear expired / not-yet-valid / valid status.
  4. 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

ClaimNameMeaning
issIssuerWho created the token, e.g. your auth server’s URL
subSubjectWho the token is about, usually the user ID
audAudienceWhich API or app the token is meant for
expExpirationUnix time (in seconds) after which the token must be rejected
nbfNot beforeUnix time before which the token isn’t valid yet
iatIssued atUnix time when the token was created
jtiJWT IDA 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

algTypeVerified with
HS256, HS384, HS512HMAC with a shared secretThe same secret that signed it (this tool can verify these)
RS256, RS384, RS512RSA signatureThe issuer’s public key, often published as a JWKS URL
PS256, PS384, PS512RSA-PSS signatureThe issuer’s public key
ES256, ES384, ES512ECDSA signatureThe issuer’s public key
EdDSAEd25519 signatureThe issuer’s public key
noneUnsignedNothing. 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 alg header.
  • 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 iss and aud, 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 };
}

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 exp was set from the wrong time zone. JWT times are always UTC.
  • Expiry date tens of thousands of years away: exp was set in milliseconds (JavaScript’s Date.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.

esc
↑↓ navigate↵ open