Skip to content
Utilerio

JWT Encoder

Build and sign a JSON Web Token with HS256, HS384 or HS512 using your own secret.

Used only in your browser to compute the signature — never sent anywhere.

Header

{
  "alg": "HS256",
  "typ": "JWT"
}

Token

The result will appear here.

Signing happens entirely in your browser via the Web Crypto API — the secret and payload are never sent to a server.

Was this tool useful?

About this tool

A JSON Web Token is three base64url segments — header, payload, signature — joined by dots. The signature is what makes a JWT trustworthy: anyone can read the payload, but only someone holding the secret can produce a signature the server will accept.

This tool builds and signs that token entirely with the Web Crypto API's HMAC implementation. The secret you type is used locally to compute the signature and is never transmitted anywhere.

How to use it

  1. Pick an algorithm: HS256, HS384 or HS512 (the number is the SHA hash size in bits).
  2. Edit the payload JSON — common claims are `sub` (subject), `iat` (issued at, seconds since epoch) and `exp` (expiry).
  3. Enter the shared secret both sides of your integration already agree on.
  4. Press Sign to get the finished token, ready to paste into an Authorization: Bearer header.

Examples

A minimal payload

With secret "my-secret" and HS256, this produces a token whose signature changes completely if a single character of the payload or secret changes.

{ "sub": "42", "iat": 1700000000 }

Common problems

The server rejects a token this tool produced.
Confirm the server expects HMAC (HS256/384/512), not an asymmetric algorithm like RS256 or ES256 — those need a private key rather than a shared secret, and this tool doesn't support them. Also check both sides use the exact same secret string.

Frequently asked questions