darinor
Tools

JWT Decoder & Encoder

Decode a JSON Web Token to inspect its header and payload, or encode and sign one with an HMAC secret. The signature is never verified when decoding, and nothing is sent to a server.

How it works: the header and payload are base64url-decoded and parsed as JSON entirely in your browser. No cryptographic verification is performed, so a valid-looking decode does not mean the token is authentic.

Header
—
Payload
—

About this tool

JWT Decoder & Encoder

The Encode tab builds a signed JWT from a header, a payload, and a secret. Edit the two JSON objects, pick the algorithm in the header's alg field (HS256, HS384 or HS512), and the token is signed as you type using the browser's Web Crypto API. It is a JWT generator for testing: minting a token to hit a local API, reproducing a bug with a specific set of claims, or checking what your server does with a token that is expired, has the wrong audience, or is unsigned.

It warns about the mistakes that matter: a secret shorter than the hash output (RFC 7518 §3.2 requires at least 32 bytes for HS256, 48 for HS384 and 64 for HS512, and short secrets can be brute-forced offline), a payload without an exp claim, and alg: none. The none form produces an unsigned token on purpose, so you can confirm your server rejects it. Asymmetric algorithms (RS256, ES256) are not supported: signing with a private key is exactly the kind of thing that should not be pasted into any web page.

This JWT decoder takes a JSON Web Token and shows you exactly what's inside it: the header (signing algorithm and token type), the payload (claims like issuer, subject, and expiry), and a live readout of timestamp claims in human-readable form.

Decoding is done entirely in your browser with no upload and no server — which makes it safe to inspect tokens from development, staging, or production environments that you would not want to paste into an online service.

The decoder does not verify the signature, so a successful decode does not mean a token is authentic. It also flags tokens that declare alg: none, a well-known JWT vulnerability where a server that accepts unsigned tokens can be tricked into trusting a forged one.

JWTs, JWKs, and certificates are related but distinct: a JWT is the token, a JWK (JSON Web Key) is the key format published at a JWKS endpoint, and an x5c header parameter (RFC 7515) embeds the signing certificate chain in the token itself as Base64-encoded DER. This decoder shows you the header and payload — if the header carries x5c, the certificate value it contains is a job for the X.509 certificate decoder, which reads the same fields a TLS certificate has: subject, issuer, and validity.

When to use it

  • Debug an auth failure during development

    Paste the token your identity provider issued and check the alg, exp, and custom claims in one glance.

  • Inspect a suspicious token safely

    Since decoding never leaves your browser, you can inspect a token from an unknown source without handing it to a third party.

  • Check whether a token is expired

    Timestamp claims (exp, iat, nbf) are shown as readable UTC dates, with expired tokens flagged in red.

Questions

How do I generate a JWT?

Switch to the Encode tab, edit the header and payload JSON, and enter a secret. The signed token appears as you type. Header and payload are serialized as compact JSON and signed with HMAC-SHA using the algorithm named in the header (HS256 by default).

Which algorithms can the encoder sign with?

HS256, HS384 and HS512 (HMAC with a shared secret), plus the unsigned none form for testing. RS256, ES256 and other asymmetric algorithms are not supported.

Is my secret sent anywhere?

No. The HMAC is computed in your browser with the Web Crypto API and nothing is uploaded. Still, use a throwaway secret for testing rather than a production one.

Is my JWT uploaded to a server?

No. The token is decoded entirely in your browser. Nothing is uploaded and nothing is logged.

Does this tool verify the JWT signature?

No. This is a decoder, not a verifier. A successful decode only means the header and payload were valid base64url-encoded JSON — it does not prove the token is authentic.

What does the alg: none warning mean?

A token that declares alg: none claims to require no signature. Servers that do not explicitly reject this algorithm can be tricked into accepting a forged, unsigned token — a well-known JWT vulnerability class.

Why do timestamp claims look wrong?

JWT timestamps are Unix seconds. The decoder converts them to UTC dates for readability, so the values you see may differ from the raw numbers by your timezone.