JWT Encoder / Signer

Enter a JSON payload and a secret, choose HS256, HS384 or HS512 and get a signed JWT. Handy for generating test tokens for local development.

Use the tool

Why this tool exists

Developing an API that accepts JWTs means you constantly need tokens with specific claims: an expired one, one with a different role, one with a missing field. Writing a small script each time is slow.

This tool builds the header, encodes your JSON payload, and signs it with HMAC using the secret you provide. The result is a standard token that any HS-capable library verifies. It is meant for tests and learning. The signing runs in your browser, so your test secret is not uploaded, but never mint production tokens with a real signing secret on a page you do not control.

How to use it

  1. Paste the payload as valid JSON, for example {"sub":"123","role":"admin"}.
  2. Enter the secret used to sign the token.
  3. Choose the algorithm: HS256, HS384 or HS512.
  4. Copy the token and use it in your test request.

Frequently asked questions

Does it add exp or iat automatically?

No. The payload is signed exactly as you write it. Add your own exp, iat and nbf as Unix seconds. The Unix Timestamp Converter helps you calculate those values.

Which algorithms are supported?

Only the HMAC family: HS256, HS384 and HS512, which use a shared secret. RSA, ECDSA and EdDSA tokens need a private key and are not produced here.

Why is the JSON rejected?

The payload must be valid JSON: double-quoted keys and strings, no trailing commas. Run it through a JSON validator first if you are unsure.

Can I use these tokens in production?

They are valid, but the tool is intended for development and learning. Create production tokens in your own server code, with a secret that is stored and rotated properly and never typed into a web page.