Decode a JSON Web Token’s header and payload, see exp, iat and nbf as dates, and check HS, RS, PS, ES or EdDSA signatures
Paste a JWT to read its header and claims, check when it expires, and verify its signature with the secret or the public key. The token and the key stay on your device.
How to use it
Paste the token; a leading "Bearer" prefix is fine. Read the header and payload; exp, iat and nbf are shown as dates with "expires in …", and a time that looks like milliseconds is pointed out. Optional: enter the secret (HS256/384/512) or paste the public key (RS, PS, ES, EdDSA) to check the signature. To make a test token, choose Sign a token, edit the claims and sign with a secret or a private key.
Example
Decode the payload
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKx…
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
}iat 1516239022 = 18 Jan 2018, 01:30:22 UTC.
The three parts of a JWT
Sources: RFC 7519
Why decode tokens locally
Verifying a JWT in code
import { jwtVerify } from 'jose';
const key = new TextEncoder().encode(process.env.JWT_SECRET);
const { payload } = await jwtVerify(token, key, { algorithms: ['HS256'] });
// throws when the signature, exp or nbf failsSources: RFC 8725: JWT best current practices
When verification fails
Paste the token here: the header shows alg and kid, the claims show exp and nbf as dates, and the signature check says whether your secret or key matches.
| Node.js | Python | Usual cause |
|---|---|---|
jwt malformed | Not enough segments | Not three parts with two dots: "Bearer " or quotes copied along |
invalid signature | Signature verification failed | Another secret or key; a Base64 secret used as text; the token was edited |
jwt expired | Signature has expired | exp is past, or the server clock is ahead: allow a few seconds of leeway |
jwt not active | The token is not yet valid (nbf) | nbf is in the future: clocks out of step |
invalid algorithm | The specified alg value is not allowed | The header’s alg is not in your allowed list (RS256 sent, HS256 expected) |
jwt audience invalid. expected: … | Audience doesn’t match | aud names another API than the one checking it |
Sources: jsonwebtoken: errors, PyJWT: exceptions
Registered claims
| Claim | Meaning |
|---|---|
iss | Issuer: who created the token |
sub | Subject: usually the user id |
aud | Audience: which API should accept it |
exp | Expiry, Unix seconds: reject after this time |
nbf | Not before, Unix seconds: reject before this time |
iat | Issued at, Unix seconds |
jti | Unique token id, so a token can’t be replayed |
Sources: RFC 7519 §4.1
Questions
- Does decoding a JWT prove it is valid?
No. Anyone can create a token with any payload. Only a signature check with the right key proves who issued it, and your server must also check exp, nbf, iss and aud. - Can it verify RS256, ES256 or EdDSA tokens?
Yes. Paste the public key and the page says “Signature valid” or “Signature does not match”, with the algorithm: RS256/384/512, PS256/384/512, ES256/384/512 and EdDSA (Ed25519). HS256, HS384 and HS512 are checked with the shared secret. Decoding works for every algorithm. - Which key formats can I paste?
A PEM public key (BEGIN PUBLIC KEY or BEGIN RSA PUBLIC KEY), a certificate (its key is used), a JWK, or a JWK set such as a /.well-known/jwks.json file, where the key with the token’s kid is picked. For HS tokens, the secret as text, or a JWK of type oct. A private key also works, only its public half is used, but checking needs just the public key. - What does alg "none" mean?
The token has no signature at all, so the page has nothing to check. An API must reject such tokens unless it expects them; accepting them by mistake is a known attack (RFC 8725 §2.1). - Can I make a signed test token?
Yes. Sign a token opens the decoded header and payload; edit them, pick the algorithm and enter an HS secret or paste a private key (PKCS#8 PEM or a private JWK). The token is signed in your browser and can be decoded here in one click. - My HS256 secret is Base64: why doesn’t the signature match?
Some servers keep the secret as Base64URL-encoded bytes. Turn on Base64URL beside the secret and the page decodes it before checking; when the other reading would match, the page says so. - Is the token, secret or key stored?
No. The token, the secret and the key stay in this browser tab: they aren’t sent unless you press Share; a shared result is locked with your password first. They aren’t kept in recent work, and are gone when you close it.