JWT Encoder & Verifier

Encode and verify HMAC-signed JWTs (HS256, HS384, HS512) in your browser and check their time claims.

  • Runs locally in your browser
  • No upload required

Try it

Used to check exp and nbf when verifying.

Mode
encode
Algorithm
HS256
Header
{ "alg": "HS256", "typ": "JWT" }
Payload
{ "sub": "1234567890", "iat": 1516239022 }
Token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc

Supported formats

Input
text, select, number
Output
text, boolean

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Encoded an HS256 JWT with the supplied payload.

How it works

  • Serialized the header (alg + typ) and the payload as compact JSON.
  • Base64url-encoded both segments to form the signing input.
  • Computed the HS256 signature over the signing input with the supplied secret.
  • Joined the signing input and the base64url signature into the compact token.
  • The secret stays in your browser; the token is built here and never sent.

Methodology

  1. Per RFC 7515, build the signing input as base64url(header) + '.' + base64url(payload) using the compact JSON serialization.
  2. Sign the signing input with HMAC-SHA-256/384/512 and the caller's secret, per RFC 7518.
  3. Encode the signature as base64url and append it to the signing input.
  4. On verification, recompute the signature and compare in constant time, then evaluate `exp` and `nbf` against the supplied reference time per RFC 7519.

Usage

  1. Choose encode or verify.
  2. To encode, paste a JSON payload object and the HMAC secret, then pick HS256, HS384 or HS512.
  3. To verify, paste the compact token and the secret; optionally supply a reference time to check exp and nbf.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

The canonical HS256 example

jsonSelect to copy
{
  "mode": "encode",
  "algorithm": "sha256",
  "payload": "{\"sub\":\"1234567890\",\"iat\":1516239022}",
  "secret": "your-256-bit-secret"
}

Verify that token

jsonSelect to copy
{
  "mode": "verify",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc",
  "secret": "your-256-bit-secret"
}

Reject an expired token

jsonSelect to copy
{
  "mode": "verify",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc",
  "secret": "your-256-bit-secret",
  "now": 4000000000
}

Limitations

Signed is not encrypted

A JWT is a compact, URL-safe way to carry claims. Its payload is only base64url-encoded, so it is readable by anyone who holds the token. Signing proves integrity and origin, not confidentiality, and only when the verifier actually checks the signature and the intended algorithms.

Verify the algorithm, not just the signature

Classic JWT vulnerabilities come from accepting the algorithm named in the token. This tool accepts only the HMAC family and rejects `alg: none`; a production server should likewise pin the allowed algorithms and keys.

Frequently asked questions

Is a JWT encrypted?
No. A JWS (the usual 'JWT') is signed, not encrypted: anyone can read the header and payload. Never put a secret in the payload. Confidentiality needs JWE, which this tool does not implement.
Why does my RS256 token not verify?
Asymmetric signatures require a public or private key and the RSA/ECDSA primitives. This browser tool implements HMAC verification only, and states that limit instead of pretending to handle public-key tokens.
Does the secret leave my browser?
No. Signing and verification run locally with the bundled HMAC core. The page has no network or storage path.

Sources

  1. RFC 7515: JSON Web Signature (JWS) — IETF
  2. RFC 7519: JSON Web Token (JWT) — IETF
  3. RFC 7518: JSON Web Algorithms (JWA) — IETF