HelperCrate

JWT Encoder

Build and HS256-sign JSON Web Tokens from header and payload JSON, entirely in your browser.

Your files never leave your device. Everything runs in your browser.

What JWT Encoder does

JWT Encoder builds a signed JSON Web Token from three inputs: a header object, a payload object and a secret. It Base64URL-encodes the first two and signs header.payload with HMAC-SHA256 through the Web Crypto API, producing the familiar three-part token.

HS256 is a symmetric algorithm: the same secret signs and verifies. That suits services you control end to end and fits poorly when a third party must verify tokens without being able to mint them, which is the problem RS256 and ES256 solve.

Everything runs locally and the secret lives only in the password field. Two details matter before you use the output. Leaving the secret empty produces an unsigned two-part token, and the header's alg value is not enforced, because signing is always HMAC-SHA256.

How to use JWT Encoder

  1. Edit the Header JSON; it starts as a standard HS256 token header.
  2. Edit the Payload JSON with the claims you need. Nothing is added automatically, not even iat.
  3. Type the test secret into the key field, or leave it empty to produce an unsigned token.
  4. Click Encode and Sign; broken JSON is reported in a toast instead of a token.
  5. Use Copy token to place the result on the clipboard.

Features

Tips and common mistakes

Frequently asked questions

Which algorithm does it use?

HMAC-SHA256, also called HS256, through the browser's Web Crypto API. There is no RSA or ECDSA option.

Is the secret sent anywhere?

No. It stays in page memory and is used locally for the HMAC operation. Nothing is uploaded or stored.

What happens if I leave the secret empty?

The tool outputs the header and payload without a signature, in two parts. Many libraries treat that as an unsigned and therefore invalid token.

Can it verify tokens too?

No. Verification is not part of this tool. The companion JWT Decoder shows token contents but also does not verify signatures.

Why does the header say HS256?

It is a sensible default. You can edit the JSON, but changing alg does not change the signing algorithm, and a mismatch confuses verifiers.

Is HS256 secure for my application?

That depends on the whole system: secret quality, storage, rotation and where the token is accepted. The algorithm choice alone does not make a system secure.

Header, payload and secret are processed locally in your browser; nothing is uploaded or stored.