OpsecForge Hub/JWT Decoder
Local Inspection • No Tool-Input Upload

JWT Decoder
Securely Inspect JSON Web Tokens

Browser-Only Execution
No Tool-Input Backend
Timestamp Parsing
Decoded token data will appear here...

What is a JWT Decoder?

A JWT (JSON Web Token) Decoder is a specialized tool that parses and displays the contents of JWT tokens without requiring server-side processing. JWTs are compact, URL-safe tokens used for authentication and information exchange in modern web applications.

A signed JWT (a JWS) consists of three Base64Url-encoded parts separated by dots: the header, the payload (carrying claims and user data), and the signature. Developers frequently need to inspect these tokens during debugging or security audits to verify token structure and claims.

An encrypted JWT (a JWE) has five parts instead, and only its header can be read without the key. Paste one and this page shows that header and the size of each part, and can decrypt the claims locally with a key you supply; see encrypted JWTs below.

How local decoding works

When you paste a compact JWT, JavaScript in this browser tab parses the three segments and applies Base64URL decoding in memory. OpsecForge does not send the pasted token to a tool-processing backend or include its contents in analytics events.

The site still loads normal page resources and aggregate analytics, and browser extensions or a compromised device remain outside this tool's control. Follow your organization's token-handling policy and prefer synthetic or revoked tokens when inspection does not require a live bearer credential.

Smart Timestamp Parsing

Common JWT claims like exp, iat, and nbf are Unix timestamps — raw numbers that are hard to read at a glance. Our decoder automatically converts them to human-readable dates in both UTC and your local timezone, plus a relative description such as "3 hours ago" or "in 2 days". Each claim is read by its own meaning: only an exp in the past is shown as expired, an nbf in the future is shown as not yet valid, and iat and auth_time are displayed as times only (a time in the future is flagged as possible clock skew). Values outside the range a JavaScript date can represent are shown as-is and marked out of range.

Decoding does not validate a JWT

Anyone holding a JWT can usually decode its header and payload. Treat those values as untrusted until a server verifies the expected signature, issuer, audience, time constraints, and token type. Authorization remains a separate decision after validation. The optional local signature check on this page covers only the signature step.

Security Analysis

This decoder flags unsigned alg: none headers, HMAC tokens, expired exp values, nbf values that are still in the future, and missing timestamp claims as review signals. The signature is checked only if you choose to run the optional local verification with a key you supply. Neither step establishes that a claim is trustworthy, tests server configuration, or proves that a token is safe to accept.

How signature verification works here

A JWS signature covers the ASCII string base64url(header).base64url(payload) exactly as it appears in the token, not the decoded JSON. For HS256 the signature is base64url(HMAC-SHA256(secret, signingInput)). This synthetic token was signed with the test secret test-secret-not-for-production-0123456789:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2lzc3Vlci5leGFtcGxlLnRlc3QiLCJzdWIiOiJ0ZXN0LXVzZXItMTIzIiwiYXVkIjoidGVzdC1hdWRpZW5jZSIsImlhdCI6MTcwMDAwMDAwMCwiZXhwIjo0MTAyNDQ0ODAwfQ.zcPxWi1Jf8zxdX2k8ZrQ6jGt5luyf-YJQ5fs3xZudJw

Paste it above, open "Verify signature locally", enter that secret, and the check should report a match. Change one character of the secret or the payload and it should report a mismatch. The same check in Node.js:

import { createHmac, timingSafeEqual } from 'node:crypto';
const [header, payload, signature] = token.split('.');
const expected = createHmac('sha256', secret)
  .update(header + '.' + payload)
  .digest();
const given = Buffer.from(signature, 'base64url');
// Constant-time comparison; the length check comes first because timingSafeEqual throws on a mismatch.
console.log(given.length === expected.length && timingSafeEqual(given, expected));

For RS*, PS*, ES* and EdDSA tokens you paste the issuer's public key as a PEM (BEGIN PUBLIC KEY), a single JWK, or a JWKS; with a JWKS the token's kid selects the key. ES* signatures are the raw r||s form (RFC 7518 section 3.4), and RSA keys under 2048 bits are checked but flagged (RFC 7518 sections 3.3 and 3.5). EdDSA means Ed25519 here: an OKP JWK with crv Ed25519 or an SPKI PEM, and a 64-byte signature (RFC 8037). Ed448 is not supported, and a browser whose Web Crypto lacks Ed25519 will say so instead of giving a result. HMAC secrets shorter than the hash output are flagged too (section 3.2). The page does not fetch a JWKS from a URL, and it does not store or send the key.

This page reads the algorithm from the token header only because it is a debugging aid and has no server configuration to consult, and it refuses to use a public key as an HMAC secret. A real verifier must not trust the token's own alg: RFC 8725 section 3.1 requires the library caller to fix the accepted algorithms and to check that each key is used with exactly one algorithm. See the JWT vulnerabilities and validation guide for how alg: none and RS256-to-HS256 confusion happen, and the JWT Encoder to create HMAC-signed test tokens. A matching signature does not make a token trustworthy: you still need to check iss, aud, exp, the token type, and where the key came from.

Encrypted JWTs (JWE): what you can read without the key

A token with five dot-separated parts is a JWE in compact serialization (RFC 7516 section 3.1). Pasting it into a decoder that expects three parts gives an error, and Base64URL-decoding the long middle part gives random-looking bytes, because the claims are encrypted. The parts are:

PartReadable without the key?What it holds
1. Protected headerYes: Base64URL-encoded JSONalg (how the content key is protected), enc (how the content is encrypted), often kid, and cty: "JWT" when the content is another JWT
2. Encrypted keyNoThe content encryption key, encrypted for the recipient. Empty for dir and plain ECDH-ES. With RSA its length equals the recipient's key size (256 bytes for a 2048-bit key)
3. Initialization vectorYes, but it is not secret96 bits for the AES-GCM algorithms, 128 bits for the AES-CBC with HMAC ones
4. CiphertextNoThe encrypted claims (or the encrypted inner JWT). With AES-GCM it is exactly as long as the plaintext, so its length is visible to anyone
5. Authentication tagNoIntegrity check over the header, IV and ciphertext: 128 bits for AES-GCM and A128CBC-HS256, 192 and 256 bits for the two larger CBC variants

So without the key you can still learn which algorithms and key ID were used, how large the recipient's RSA key is, and roughly how long the claims are. This page reports those and warns when a size does not fit the declared algorithm (sizes from RFC 7518 section 5), when the header uses zip (RFC 8725 section 3.6 advises against compressing before encrypting), or RSA1_5 (section 3.2 of the same RFC recommends RSAES-OAEP instead).

Decrypting a JWE locally

This synthetic token uses dir with A256GCM: the shared 256-bit key encrypts the claims directly, so part 2 is empty and you can see two dots in a row.

eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwidHlwIjoiSldUIn0..AAECAwQFBgcICQoL.7mJ5qTJXaSFPwyOceYGMFCIAOyYwODrDyV6KsokzwiPEyR5FwVoyuuaWce2WdJ9WG4ID8pXqBvXm5hoNzf1hnZpVfi-jA4n1zsXfHf3wBLOogrEJ60D3OGjNXG-X_-QH5F_9FI5Y0yUIX2hA1nWYMD0dlQ.5aycbBlxP3ltTC1sMQC1tg

Paste it above, open "Decrypt locally", and enter the test key 0f1e2d3c4b5a69788796a5b4c3d2e1f00f1e2d3c4b5a69788796a5b4c3d2e1f0. The claims appear, with iat and exp shown as dates. Change one character of the key, or of any part of the token, and decryption fails as a whole: AES-GCM does not return partial plaintext. The same steps in Node.js:

import { createDecipheriv } from 'node:crypto';
const [header, encryptedKey, iv, ciphertext, tag] = token.split('.');
const decipher = createDecipheriv('aes-256-gcm', Buffer.from(keyHex, 'hex'), Buffer.from(iv, 'base64url'));
// The additional authenticated data is the header segment exactly as it appears in the token.
decipher.setAAD(Buffer.from(header, 'ascii'));
decipher.setAuthTag(Buffer.from(tag, 'base64url'));
const claims = Buffer.concat([
  decipher.update(Buffer.from(ciphertext, 'base64url')),
  decipher.final(), // throws if the key, header, IV, ciphertext or tag is wrong
]).toString('utf8');

What you paste depends on alg: the shared key for dir, A128KW/A192KW/A256KW and A128GCMKW/A192GCMKW/A256GCMKW (as an octJWK, hex or Base64URL); the recipient's private key for RSA-OAEP, RSA-OAEP-256 and the ECDH-ES family on P-256, P-384 or P-521 (as a PKCS#8 PEM or a JWK); or the password for the PBES2 algorithms. All six enc values from RFC 7518 are handled, and a zip: "DEF" plaintext is inflated up to 1 MiB. The implementation is tested against the worked examples in RFC 7520 section 5. RSA1_5tokens can be inspected but not decrypted, because browsers' Web Crypto does not provide RSAES-PKCS1-v1_5 decryption; X25519 keys and the JSON serialization of JWE are not supported either.

Decrypting needs a secret: the shared key or a private key. Use test keys here, as with HMAC secrets. If the plaintext turns out to be another token (a nested JWT, normally signed and then encrypted), the page offers to decode that inner token so you can check its signature as usual. A JWE that decrypts correctly says nothing about who created it: with RSA-OAEP or ECDH-ESanyone who has the recipient's public key can encrypt any claims they like, which is why the inner signature matters. The pac4j-jwt CVE-2026-29000 write-up describes a library that accepted an unsigned token inside a JWE.

Understand HS256 and JWT validation failures

HS256 is not inherently vulnerable. Learn how weak secrets, algorithm confusion, untrusted key selection, and missing claim checks create real failures.

Read the JWT vulnerabilities and validation guide →

FAQ

Can this tool validate JWT signatures?

Optionally, for HS256/384/512, RS256/384/512, PS256/384/512, ES256/384/512 and EdDSA (Ed25519 only, in browsers whose Web Crypto supports it). Click Verify signature locally and supply the shared secret or the public key (PEM, JWK or JWKS); the check runs in this browser tab with Web Crypto and the key is not stored or sent. It checks the signature only, not iss, aud, exp or whether you should trust the key, and a real verifier must fix the accepted algorithm itself instead of reading it from the token.

Does it support encrypted JWTs (JWE)?

Yes, in compact form (five parts). Without a key it shows the protected header (alg, enc, kid) and the size of the encrypted key, IV, ciphertext and tag. With a test key you paste it decrypts locally for dir, AES Key Wrap, AES-GCM key wrap, RSA-OAEP, RSA-OAEP-256, ECDH-ES on the NIST curves and PBES2. RSA1_5 can be inspected but not decrypted, and the JSON serialization is not supported. A JWE that decrypts is not thereby authentic.

What timestamps are automatically converted?

The decoder recognizes exp (expiration), iat (issued at), nbf (not before), and auth_time (authentication time) claims and displays them as human-readable dates. Only exp can mark a token as expired; the others are shown as times, with a note when nbf has not been reached or iat lies in the future.

Share this: