JWT Encoder / Decoder

Decode and verify JSON Web Tokens, or build and sign a new one. Everything runs in your browser.

Token

A JSON Web Token (JWT) is a compact, URL-safe string used to represent claims between two parties. It consists of three base64url-encoded parts separated by dots: header.payload.signature.

The header declares the token type (typ) and the signing algorithm (alg), such as HS256 (HMAC-SHA256) or RS256 (RSA-SHA256). The payload contains the claims — statements about an entity (typically a user) and additional metadata. Common registered claims include iss (issuer), sub (subject), aud (audience), iat (issued at), and exp (expiration time).

The signature is computed by the issuer over the header and payload using a secret or private key. Decoding needs no key at all — the first two parts are only encoded, not encrypted, so treat everything in a payload as public. Never put a password, a card number or anything else sensitive in one unless the token is also encrypted (JWE).

Verifying a signature

Paste the key into the Verify Signature box in Decode mode and this tool checks the signature with your browser's built-in WebCrypto. For the HS family you need the shared secret; for RS and ES you need only the public key, which is the point of asymmetric signing — anyone can check a token, but only the holder of the private key can mint one.

A valid signature proves exactly one thing: the header and payload have not changed since they were signed by whoever holds that key. It does not mean the claims are true, that the issuer is who you expect, or that the token is still current. A verifier still has to check iss, aud and exp itself.

Why this tool refuses some tokens

You choose the algorithm; the tool will not read it out of the token and trust it. If the header says HS256 and you selected RS256, verification is refused rather than attempted. That mismatch is the algorithm-confusion attack: a server that trusts the header can be handed an HS256 token and will use its RSA public key as the HMAC secret — and a public key is, by definition, something the attacker already has, so they can forge any token they like.

For the same reason a token declaring alg: "none" can never verify here. It carries no signature at all, so its claims are unauthenticated input; libraries that honoured none were the source of a well-known family of authentication bypasses. Decode mode still shows you such a token — it just flags it rather than pretending a key would help.

Signing a token

Encode mode edits the header and payload as JSON and signs them. The algorithm you select is always what gets written into the header, so a token built here cannot claim to be signed one way while actually being signed another. HMAC secrets should be at least as long as the hash output — 32 bytes for HS256, 64 for HS512 (RFC 7518 §3.2) — because a short secret can be brute-forced offline from a single captured token. For RSA and ECDSA the tool can generate a fresh key pair for you, since browsers need PKCS#8 rather than the PKCS#1 format openssl genrsa produces.

Nothing you paste here leaves your browser: there is no server call, no analytics, and neither tokens nor keys are written to the URL or to storage. Clear keys wipes every key field at once. Related tools: Base64 Encoder / Decoder for the encoding JWTs are built on, and Hash Generator for the SHA-2 digests underneath every one of these algorithms.

What is a JWT?

A JSON Web Token (JWT) is a compact, URL-safe string representing claims between two parties. It consists of three base64url-encoded parts separated by dots: header.payload.signature. JWTs are widely used for authentication tokens in APIs and single-page applications.

Can this tool verify a JWT signature?

Yes. Paste the token in Decode mode, pick the algorithm and supply the key — the shared secret for HS256/384/512, or the public key in PEM form for RS256/384/512 and ES256/384/512. Verification runs in your browser via WebCrypto, so the key is never transmitted. Decoding a token still requires no key at all; only verification does.

Is it safe to paste my JWT or my signing key into this tool?

Everything runs in your browser — there is no server call, no analytics, and neither the token nor the key is written to the URL or to local storage, so nothing is left behind in your history. Treat production tokens and private keys with the same care as passwords regardless, and use the Clear keys button when you are done. If a token grants access to sensitive resources, revoke it after debugging if you have any concern about exposure.

Why does verification fail with "the token header says HS256 but you selected RS256"?

That is deliberate. Taking the algorithm from the token you are checking is the algorithm-confusion vulnerability: an attacker re-signs an RS256 token as HS256 using your RSA public key as the HMAC secret, and a server that trusts the header accepts it. This tool makes you choose the algorithm and refuses when the header disagrees. If the header is right, select that algorithm instead.

Why will this tool not verify an "alg": "none" token?

A none token has no signature, so no key can verify it and there is nothing to check. Decode mode will still show you its contents, flagged as unsigned. Historically, libraries that accepted none allowed anyone to forge tokens by stripping the signature, which is why it is rejected outright here rather than reported as merely invalid.

What is the difference between HS256 and RS256?

HS256 uses a single shared secret for both signing and verifying — suitable when the issuer and verifier are the same system. RS256 uses a private key to sign and a public key to verify — suitable for multi-party systems where the token issuer and verifiers are different services, since verifiers never need the signing key. ES256 does the same with elliptic-curve keys, which are much smaller for equivalent strength.

Why does my RSA private key not work?

Browsers read PKCS#8 keys ("BEGIN PRIVATE KEY"), while openssl genrsa emits PKCS#1 ("BEGIN RSA PRIVATE KEY"). Convert it with: openssl pkcs8 -topk8 -nocrypt -in key.pem -out pkcs8.pem. Alternatively use the Generate key pair button, which produces a PKCS#8 private key and the matching public key.

What does "exp" mean in a JWT payload?

exp is the expiration time claim — a Unix timestamp (seconds since epoch) after which the token must not be accepted. iat is the issued-at time. nbf is "not before" — the token must not be used before this time. This tool shows these as human-readable dates and warns when a token is expired, not yet valid, or has no expiry at all.

Updated August 15, 2026

This site is vibe coded. The tools here were built largely by AI, so treat what they tell you as a starting point rather than an answer — double-check anything that matters before you rely on it.

Crunchify.net — 98 free tools, no ads, no tracking.