Contact

Tools  /  Security  /  JWT Decoder & Generator

JWT Decoder & Generator

Decode, verify and sign JWTs -- HS/RS/PS/ES algorithms, claims explained, test key generation.

What this tool does

Paste any JWT (JSON Web Token) to see its header and payload decoded and pretty-printed, every standard registered claim explained in plain English with its actual expiry status, and its signature checked against a secret or public key you provide. Switch to Build & Sign to construct and sign a new token with any of twelve algorithms — HS256/384/512 (shared secret), RS256/384/512 and PS256/384/512 (RSA, two padding schemes), or ES256/384/512 (elliptic curve) — and generate a throwaway test key pair on the spot if you don't already have one, so you can try the asymmetric algorithms without needing OpenSSL.

How a JWT is actually structured

A JWT is three Base64URL-encoded segments joined by dots: header.payload.signature. The header names the signing algorithm (and optionally a key ID). The payload carries claims — the actual data, like who the token is for and when it expires. The signature is computed over the header and payload together, so changing either one invalidates it if whoever checks the token actually verifies the signature — the header and payload are only Base64URL-encoded, not encrypted, so anyone can read them without the key; the signature is what prevents anyone from forging or altering them undetected.

Standard claims, explained

This tool recognizes the registered claims from the JWT spec and shows what each one means next to its actual value: iss (issuer — who created the token), sub (subject — who the token is about), aud (audience — who it's intended for), exp (expiration time, with a live valid/expired check), nbf (not valid before this time), iat (issued at), and jti (a unique token ID, useful for revocation lists). None of these are required or enforced by the JWT format itself — a server has to actually check exp for expiry to matter, for instance — but nearly every real system uses most of them.

Choosing an algorithm, and a real security pitfall

HS* algorithms use one shared secret for both signing and verifying — simple, but everyone who needs to verify a token also needs the secret, which means they could also forge one. RS*/PS*/ES* use a key pair: sign with the private key, verify with the public key, so a token issuer can hand out the public key freely and nobody who merely verifies tokens can forge new ones. A genuinely dangerous real-world bug class is trusting the alg field from an untrusted token at all — an attacker who can submit "alg":"none" or swap an RS256 token's algorithm to HS256 (then "sign" it with the known public key as an HMAC secret) can sometimes bypass verification entirely on a vulnerable server. A correct verifier pins the expected algorithm itself rather than reading it from the token.

Privacy

Decoding, verifying, signing, and key generation all happen locally using the Web Crypto API. Nothing — not the token, not a secret, not a private key — is ever sent to a server.

Frequently asked questions

Is my token, secret or private key uploaded anywhere?
No. Every operation — decoding, signature verification, signing, and test key pair generation — runs entirely in your browser via the Web Crypto API. Nothing is sent to a server.
Why can I read the payload without any key?
A JWT's header and payload are Base64URL-encoded, not encrypted — anyone can decode them, with or without the signing key. The signature is what proves the content hasn't been tampered with, not what hides it. Never put secrets in a JWT payload.
What's the difference between HS256 and RS256?
HS256 uses one shared secret for both signing and verifying — fast and simple, but anyone who can verify a token also has the power to forge one. RS256 (and PS256/ES256) use a key pair: you sign with a private key and share the public key for verification, so verifiers can't forge new tokens.
I don't have a private key for RS256/ES256 -- can I still try it?
Yes — switch to Build & Sign, pick an RS/PS/ES algorithm, and use "Generate test key pair" to create one on the spot. It fills in the private key for signing and shows the matching public key PEM to paste into Decode's verify field.
Why does it warn about "alg: none"?
Some vulnerable JWT libraries historically trusted the algorithm named inside the token itself, so an attacker could submit a token with "alg":"none" and no signature at all and have it accepted. A correct verifier always pins the expected algorithm server-side rather than trusting the token's own header.
What does the expired/valid badge actually check?
It compares the token's exp (and nbf, if present) claim against your current system clock and shows whether the token is currently within its valid window. This is informational only — it does not mean the signature is valid or that any server actually enforces expiry.
Which algorithms are supported for signing?
All twelve from the JWT spec that modern browsers implement natively: HS256/384/512, RS256/384/512, PS256/384/512, and ES256/384/512 — no server-side library needed for any of them.
Theme Accent