JWT Decoder

Decode a JSON Web Token's header and claims, check expiry, and optionally verify its signature, all in your browser.

Decoding is not verification. Anyone can read a JWT's header and payload, and anyone can edit them. Only a valid signature checked with the right key proves a token is genuine. This page runs entirely in your browser, but you still shouldn't paste live production tokens or signing secrets into any website.
Examples:

Decoding and verification run in your browser with JavaScript and Web Crypto. Tokens, secrets and keys are never sent to a server or stored.

Advertisement

How to Use This JWT Decoder

Paste a JSON Web Token into the box. The decoder splits it at the dots, Base64url-decodes each part, and shows the header and payload as formatted JSON. Below them, a table explains every registered claim it finds, turning exp, nbf and iat from raw numbers into dates in UTC and in your own time zone, with a label telling you whether the token has expired or isn't valid yet. You can paste a whole Authorization: Bearer … header and the prefix is ignored. The example buttons load demo tokens signed for this page with throwaway keys, so you can try every feature without touching a real credential.

To check a signature, open Verify the signature, choose the algorithm you expect, and enter the HMAC secret or paste the issuer's public key as a PEM block or a single JWK. The check runs through your browser's Web Crypto API. It supports HS256/384/512, RS256/384/512, PS256/384/512, ES256/384/512 and EdDSA with Ed25519, though older browsers may lack P-521 or Ed25519. Warnings at the top of the results flag problems such as "alg": "none", a missing algorithm, an empty signature, an expired token, or a header that tries to supply its own key.

What a JWT Is Made Of

A JSON Web Token, defined in RFC 7519, is a compact way to pass a set of claims between two parties. The common signed form is a JSON Web Signature (RFC 7515) in compact serialization: three Base64url strings joined by dots.

  • Header: JSON that names the signing algorithm (alg), usually the type (typ: "JWT") and often a key ID (kid) that tells the receiver which key to use.
  • Payload: JSON claims such as who issued the token, who it's about, who it's for, and when it expires, plus any application data like roles or scopes.
  • Signature: the algorithm's output computed over the ASCII text base64url(header) + "." + base64url(payload).

Base64url is ordinary Base64 with - and _ in place of + and /, and with the trailing = padding removed, so tokens survive in URLs and headers without escaping. That is why the decoder rejects a segment containing + or /: it was encoded with the wrong alphabet. Our Base64 encoder and decoder handles both alphabets if you want to decode a segment by hand.

Worked Example: Decoding the HS256 Sample

Advertisement

Click the HS256 example. Its first segment is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9, which decodes to {"alg":"HS256","typ":"JWT"}. Almost every JWT starts with eyJ, because that is how a JSON object beginning {" followed by a letter looks in Base64. The payload decodes to nine claims, including "iss": "https://auth.example.com", "sub": "user-1024", "aud": "api.example.com", "iat": 1793404800 and "exp": 1793408400.

Those dates are NumericDate values, seconds since 1970-01-01 UTC, the same count our Unix timestamp converter works with. 1793404800 is 2026-10-31 00:00:00 UTC and 1793408400 is exactly 3,600 seconds later, 01:00:00 UTC, so this is a one-hour token. Because the demo was issued in the past, the decoder marks it Expired. The signature segment decodes to 32 bytes (256 bits), starting 4354ebb8, which is the size of an HMAC-SHA-256 output. Choose HS256, keep the demo secret the button fills in, and press Verify Signature: it passes. Change one character of the secret, or edit "role": "editor" in the payload to "admin" and re-encode it, and verification fails. That is the whole point of the signature.

Decoding Is Not Verification

The header and payload are encoded, not encrypted. Anyone holding a token can read its claims, and anyone can make a new token with different claims. A decoder like this one, or atob() in a browser console, tells you what a token says. Only signature verification with a trusted key tells you whether the issuer actually said it. Never make an authorization decision from a decoded but unverified token, and never put secrets such as passwords or internal API keys in a payload, since the payload is effectively public.

A valid signature still isn't enough on its own. RFC 7519 and RFC 8725, JWT Best Current Practices, tell servers to:

  • check exp and nbf against their own clock, with at most a few minutes of leeway for clock skew;
  • confirm that iss is an issuer they trust;
  • confirm that aud names them, so a token minted for one API can't be replayed against another.

The claims table in this tool helps you inspect those fields. It cannot know which issuer and audience your server expects.

Signing Algorithms: HS, RS, PS, ES and EdDSA

The algorithms are registered in RFC 7518 and, for EdDSA, RFC 8037. HS256/384/512 are HMACs: issuer and verifier share one secret, and anyone who can verify can also mint tokens. RFC 7518 requires a key at least as long as the hash output, which is 32 bytes for HS256, so the tool warns about shorter secrets. RS (RSA PKCS#1 v1.5) and PS (RSA-PSS) use an RSA key pair: the private key signs, and the public key, often published as a JWKS at an identity provider, only verifies. ES256/384/512 use ECDSA on the P-256, P-384 and P-521 curves, with short signatures. EdDSA with Ed25519 is fast and deterministic. JWS stores ECDSA signatures as the raw r‖s values, 64 bytes for ES256, not the DER format OpenSSL prints, and the decoder tells you if a signature has the wrong length for its algorithm.

Common JWT Mistakes the Decoder Flags

  • alg: none. RFC 7519 defines unsecured tokens with an empty signature. A library that honors the header can be tricked into accepting a forged token with none. Servers must allow only the algorithms they expect, which is why this tool makes you pick one.
  • Algorithm confusion. If a server that uses RS256 lets the header switch to HS256, an attacker can sign with HMAC using the server's public key as the secret. Pinning the algorithm, and keeping HMAC secrets and public keys in separate code paths, prevents it.
  • Trusting keys from the token. The jku, x5u, jwk and x5c headers point to or embed a key. Verifying with a key the token supplies proves nothing unless that key is already trusted.
  • Milliseconds instead of seconds. A 13-digit exp is almost always Date.now() used by mistake. It puts expiry tens of thousands of years in the future.
  • Encrypted tokens. A token with five parts is a JWE (RFC 7516). Only its header is readable, and the decoder shows the key-management and content-encryption algorithms without trying to decrypt.

For a longer walkthrough of claims, key rotation and where to store tokens in a browser, read our guide JWTs Explained.

Frequently Asked Questions

Is it safe to paste a JWT into an online decoder?

This decoder runs entirely in your browser and never sends the token anywhere, but the safest habit is still to avoid pasting live production tokens or signing secrets into any website. A JWT is a bearer credential: anyone who holds an unexpired token can use it. Use test tokens, or tokens that have already expired, when you only need to inspect the structure.

Does decoding a JWT verify it?

No. The header and payload are only Base64url-encoded, so anyone can read them and anyone can create a token with different contents. A token is trustworthy only after its signature has been verified with the issuer's secret or public key and its exp, nbf, iss and aud claims have been checked.

What do exp, iat and nbf mean in a JWT?

They are NumericDate claims, counted in seconds since 1970-01-01 UTC. exp is the expiration time after which the token must be rejected, nbf is the time before which it must not be accepted, and iat is when it was issued. This tool converts them to dates in UTC and your local time and shows whether the token is currently expired or not yet valid.

Why is alg none dangerous?

A token with alg none has no signature, so anyone can forge one. Some early JWT libraries trusted the alg value in the token header and accepted these unsigned tokens. Servers should accept only the specific algorithms they expect and reject none outright.

What is the difference between HS256 and RS256?

HS256 is an HMAC using SHA-256 with one shared secret, so every service that can verify a token can also create one. RS256 is an RSA signature: the issuer signs with a private key and everyone else verifies with the public key, so verifiers cannot mint tokens. RS256, ES256 and EdDSA suit tokens checked by many services or third parties.

Why can't this tool show the payload of my token?

If your token has five dot-separated parts instead of three, it is an encrypted JWT (JWE). Its claims are inside the ciphertext and can only be read with the recipient's decryption key. The decoder shows the readable header, including the key-management and content-encryption algorithms, but does not decrypt.

Sources: RFC 7519 (JWT); RFC 7515 (JWS); RFC 7516 (JWE); RFC 7518 (JWA); RFC 8037 (EdDSA in JOSE); RFC 8725 (JWT Best Current Practices); MDN: SubtleCrypto.verify().

Related Articles

Expert guides and educational resources to help you master the math.

Advertisement