admin@likeapro.dev: ~/jwt — zsh

// admin tools · 01

JWT forge

Decode any token, sign new ones with HMAC SHA-256/384/512, and verify signatures — with human-readable expiry. Pure WebCrypto, zero network.

// runs locally — nothing is uploaded

Never paste production secrets or live tokens into any website — including this one. Everything here runs locally in your browser, but treat it as a scratchpad, not a vault.

header.payload.signature

header · algorithm & type

payload · claims

time claims

DECODE local only · 0 bytes sent --:--:--

How it works

What it does

Three JSON Web Token jobs in one place. --decode splits a token into header, payload and signature, pretty-prints the claims and checks the time claims. --sign builds and signs a token with HS256, HS384 or HS512. --verify recomputes the HMAC signature with your secret and tells you whether the token is genuine. Signing and verifying use the browser's WebCrypto API, so nothing is sent anywhere.

How to use it

  1. Paste a token into --decode. A leading Bearer is stripped. Each segment is colour-coded, and iat, nbf and exp are shown as dates with "expires in" or "expired ago".
  2. In --sign, edit the JSON payload. Quick-add buttons insert iat, exp +1h or +24h, nbf and a jti. Enter a secret, or generate one sized to the algorithm, and the signed token updates as you type.
  3. In --verify, paste the token and secret. Tick secret is base64-encoded if your key is stored that way.

What the parts mean

header
Base64URL JSON naming the algorithm (alg) and type (typ).
payload
Base64URL JSON claims. It is encoded, not encrypted, so anyone holding the token can read it.
signature
HMAC of header.payload with the shared secret, Base64URL-encoded.
iat · nbf · exp
Issued-at, not-before and expiry, as NumericDate seconds since the Unix epoch (RFC 7519).

Security checks built in

  • Tokens with alg: "none" are flagged as unsigned and never reported as valid.
  • Non-HMAC algorithms such as RS256 or ES256 are decoded but not verified, because they need a public key, not a shared secret.
  • Signatures are compared in constant time.
  • A warning appears when the key is shorter than the hash output, which RFC 7518 requires as a minimum (256 bits for HS256).
  • Payload JSON errors are reported with line and column.

FAQ

Is it safe to paste a token here?

The page does all its work in your browser and sends nothing, but the safest habit is never to paste production secrets or live tokens into any website. Use test tokens and rotate anything sensitive you've exposed.

Which HMAC algorithm should I choose?

HS256 with a random 256-bit secret is the usual default. HS384 and HS512 need longer secrets (384 and 512 bits). The generate button produces a key of the right length from crypto.getRandomValues.

Why does verification fail when the payload looks right?

The signature covers the exact encoded bytes. A different secret, a base64 secret treated as plain text (or the reverse), or any change to the header or payload will fail verification.

Can it verify RS256 tokens?

Not yet. RS256 and ES256 tokens decode fine, but verifying them needs the issuer's public key. This tool handles shared-secret HMAC tokens.