JWT decoder and builder
Read a JSON Web Token, check its signature with a secret or a public key, and build a signed token to test with. It runs on your device: nothing is sent, and nothing is saved.
How it works
A JSON Web Token (JWT, RFC 7519) is three parts joined by dots: header.payload.signature. Each part is written in base64url. Paste one on the left and its parts are coloured, the header and payload are written out as formatted JSON on the right, and its times are shown as dates.
- The header says how the token is signed:
alg, the algorithm, and oftentypandkid, the name of the key. - The payload holds the claims: what the token says. A few have names everyone uses:
sub, whom it is about;iss, who made it;aud, whom it is for;exp, when it expires;nbf, when it starts to be valid;iat, when it was made; andjti, its own identifier. - The signature is worked out from the header, the payload and a key. It is what makes a token worth trusting.
Its times
exp, nbf, iat and OpenID Connect’s auth_time are counted in seconds since 1 January 1970 UTC. The decoder writes each as a date and a time on your own clock, in your time zone, with how long ago or how soon it is, and says whether the token is valid now: expired once exp has passed, not valid yet before nbf.
Checking the signature
The algorithm is always named. For HS256, HS384 and HS512, enter the shared secret, and say whether it is written as text, base64 or base64url. For the others, paste the public key: a PEM block, a certificate, or a JWK. The answer is Signature verified or Signature does not match, in words. It is worked out by your browser’s own cryptography (Web Crypto), on your device.
Building a token
Choose Build to write a header and a payload, choose the algorithm, and enter a secret or paste a private key: the signed token appears on the right, its parts coloured. Set iat to now and Set exp put the current time, or a time some minutes ahead, into the payload. To try RSA or elliptic-curve signing without a key of your own, Make a key pair to try makes one on your device and gives its public key to the decoder.
Nothing is kept
A token is a credential: whoever holds it can often act as the person it names. So this tool saves nothing, not in the browser’s storage, not in the address, and offers no link to share. Close or reload the page and it is all gone.
Questions and answers
Is the token I paste sent anywhere, or kept?
No. It is read, checked and signed in your browser, on your device, with the browser's own cryptography. Nothing you paste or type, not the token, not the secret, not a key, is uploaded or saved, and the page offers no link that would carry it. Reload the page and every field is empty.
Why can it read my token without the secret?
Because a JWT is not encrypted. Its header and payload are only written in base64url, which anyone can turn back into text. The signature does not hide anything; it proves who made the token and that nobody changed it. Never put a password or anything private in a payload.
Why does checking the signature need the key?
The signature is worked out from the header, the payload and a key. To check it, the same calculation is done again and the results compared. With HMAC (HS256, HS384, HS512) both sides share one secret. With RSA, RSA-PSS, ECDSA and EdDSA, the token is signed with a private key and checked with the public key that goes with it, which can be shared freely.
What does "Signature does not match" mean?
Either the secret or key is not the one the token was signed with, or the token was changed after it was signed, even by one character. Check the secret's encoding too. A secret written in base64 must be read as Base64, not as text.
Which algorithms and keys does it take?
HS256, HS384 and HS512 with a secret written as text, base64 or base64url; RS256, RS384, RS512, PS256, PS384 and PS512 with RSA keys; ES256, ES384 and ES512 with P-256, P-384 and P-521 keys; and EdDSA with Ed25519 keys, in browsers that have it. A public key can be a PEM block, a certificate or a JWK, or a set of JWKs; a private key a PEM block (PKCS
What is an unsigned token?
A token whose header says "alg" is "none". It has no signature, so anyone can change it and nobody can tell. The decoder says so in words, and the builder makes one only when you tick "Unsigned token", to test that a server refuses it.
Runs on your device. Nothing is sent anywhere, and nothing is saved.
Decoded
The header and payload of the token appear here.