JWT Decoder and Verifier
Paste a JWT to read it, check its dates and its signature. The token stays in your browser.
https://flxcode.com/jwt-decoder/
The token is read in this page. It is not sent, saved or put in the address. You can switch Wi-Fi off and it still works.
Paste a token to read it.
Edit the JSON. The token updates as you type.
Signs with HS256, HS384 or HS512 and a secret, or makes an unsecured token. RS, PS, ES and EdDSA need a private key. This page does not take private keys, so use a library or the openssl command for those.
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.
Problem or idea? Email us
Quick start
- Paste a token. It can be the bare token,
Bearer eyJ..., a wholeAuthorization:header, or a link with?access_token=or#id_token=in it. No token at hand? Press Try a sample token. - Read the header, the payload and the list of claims. Dates show in UTC and in your time zone, with a badge for expired, not yet valid or valid now.
- To check the signature, type the secret (HS) or paste the public key or JWKS (RS, PS, ES, EdDSA). The result shows as soon as you type.
- To make a token for a test, switch to Make a token, edit the JSON and copy the result.
What is in a token
A signed token (a JWS, RFC 7515) is three pieces joined by dots: header, payload, signature. The header and payload are JSON written as base64url. The page colours them the same way in the token and in the panels below it, so you can see where each piece starts.
issis who made the token,subwho it is about andaudwho it is for.exp,nbfandiatare times in whole seconds since 1970. A value with 13 digits is milliseconds and is wrong for a JWT. The page points that out.jtiis a unique ID. Servers keep a list of used IDs to refuse a token used twice.- Other claims, such as
scopeoremail, are defined by the system that made the token. The page explains a few common ones and shows the rest as they are.
What the page warns about
- alg none, and spellings like
None, which some libraries once accepted. - HS tokens: the same secret signs and checks, so a server that takes both HS and RS tokens can be fooled into using its public key as the secret (RFC 8725, section 3.1).
- jku, x5u and jwk in the header: a token that tells the server where its own key is. A server should not trust that (section 3.10).
- A kid with path or SQL characters, a missing
exp, aniatin the future, and times in milliseconds. - A short HS secret. RFC 7518 asks for at least as many bytes as the hash, 32 for HS256.
Which keys it takes
- HS256, HS384, HS512: a secret as plain text, base64url or base64, or a JWK with
"kty":"oct". - RS, PS:
BEGIN PUBLIC KEY,BEGIN RSA PUBLIC KEY, a certificate, or an RSA JWK. - ES256, ES384, ES512: a public key on P-256, P-384 or P-521 as PEM, certificate or JWK. A signature in DER format, as OpenSSL writes it, is reported as invalid because JWS needs the plain r and s form (RFC 7518, section 3.4).
- EdDSA: an Ed25519 key, if your browser supports it.
- A private key is refused with a message. Do not paste one into any web page.
Limits
It does not decrypt JWE tokens, does not fetch keys from a link, and does not sign with RS, PS, ES or EdDSA. It does not check iss or aud against your values, because it does not know them.
"Valid" means the signature matches the key you gave it. It does not mean your server should accept the token. For the JSON itself use the JSON formatter.
How it works and privacy
The token is split at the dots, each piece is decoded from base64url, and the JSON is read by the same parser as the JSON formatter, so a mistake shows the line and column. Signatures are checked with the Web Crypto API of your browser. The only things the page remembers are your last mode, the clock tolerance and the secret format. We count events without cookies, such as "token read" (details). Your token, secret and key are never part of them.
FAQ
Does the token leave my browser?
No. The page reads the token with JavaScript on your device. It is not put in the address, not written to storage and not part of any count we keep. Load the page, turn Wi-Fi off and paste a token: it still works. Even so, treat a live token like a password and prefer one from a test system.
Does decoding prove the token is real?
No. The header and payload are only base64url text, so anyone can read them and anyone can write them. Only the signature check tells you the token was made by whoever holds the key. A server must always check the signature before it believes a claim.
How do I check the signature?
For HS256, HS384 and HS512 type the shared secret. For RS, PS, ES and EdDSA paste the public key as PEM, a certificate, or a JWK or JWKS as JSON. The page does the check with the Web Crypto API of your browser. If you paste a JWKS with many keys, it uses the one that matches the kid in the token header.
Why can I not fetch the keys from a jwks_uri?
That would be a request from this page to another site, and the page makes no requests with your data. Open the link yourself, copy the JSON and paste it. It also avoids the problem in RFC 8725, section 3.10, where a token chooses where its own key is fetched from.
Can it decrypt a token with 5 parts?
No. A token with 5 parts is a JWE, an encrypted token (RFC 7516). The page shows its header, the algorithms and the sizes of the parts. The claims can only be read with the key of the recipient.
Why can it sign with HS but not RS or ES?
Those need a private key, and you should not paste a private key into a web page, this one included. For tests with a shared secret the page can sign for you. For the rest use your own library or the openssl command.
More from FLXCode
- JSON FormatterFormat, minify, sort and check JSON in your browser. Big numbers stay exact and errors show line and column.
- Password GeneratorMake a random password or passphrase in your browser. See the entropy and its formula. Nothing is sent.
- UUID GeneratorMake version 4 or version 7 UUIDs in your browser, 1 to 1,000 at a time. Copy or download as .txt.
- Regex TesterTest JavaScript regular expressions with live matches, groups, flags and a replace preview. Runs in your browser.