Tools / JWT Generator / Signer

JWT Generator / Signer.

Build and sign HS256, HS384 and HS512 JSON Web Tokens from a header, payload and secret.

Runs in your browser

Adds exp = iat (or now) + this many seconds.

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Token
Header . Payload
Details

About JWT Generator / Signer

The JWT Generator builds a JSON Web Token from a header, a payload and a secret and signs it with HMAC. It is meant for testing: minting a token for a local API, reproducing a token a backend should accept, or checking how a library serializes claims. Enter the payload as JSON, choose HS256, HS384 or HS512, and type the shared secret as text, Base64 or hex. The tool sets the alg header to match, base64url-encodes both parts, computes the HMAC over header.payload and appends the signature. Optional switches add iat (issued at, the current time) and exp (expiry) so you do not have to calculate Unix timestamps by hand. For example, the classic payload with sub 1234567890 and the secret "your-256-bit-secret" produces the familiar token that ends in SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c. The details panel warns when the secret is shorter than RFC 7518 requires (32 bytes for HS256, 48 for HS384, 64 for HS512); short, guessable secrets are the most common JWT weakness because anyone holding a token can brute-force them offline. Other typical mistakes are putting secrets in the payload (it is only encoded, not encrypted), using seconds versus milliseconds incorrectly in exp, and accepting alg "none", which this tool can generate only so you can test that your server rejects it. RS256 and ES256 need RSA or elliptic-curve private-key maths that this offline tool does not implement, so they are not offered rather than faked. To inspect or verify an existing token, use the JWT decoder. Signing runs in your browser and the secret is never stored in the page URL or sent anywhere.

How to Use

  1. Write the payload claims as JSON and optionally edit the header.
  2. Pick HS256, HS384 or HS512 and enter the secret in the right encoding.
  3. Copy the signed token; add iat and exp with the switches if you need them.

Frequently Asked Questions

Can it sign RS256 or ES256 tokens?

No. Those need RSA or elliptic-curve signatures with a private key, which this offline tool does not implement. Only HMAC algorithms (HS256, HS384, HS512) are supported.

How long should the secret be?

RFC 7518 requires at least as many bytes as the hash output — 32 for HS256, 48 for HS384 and 64 for HS512. Use random bytes, for example from a password generator, not a word.

Is the payload encrypted?

No. A JWT payload is only base64url-encoded; anyone with the token can read it. Never put passwords or personal data in it.

Is my secret safe here?

Signing runs in your browser. The page is marked sensitive, so inputs are not saved in the URL or history and nothing is sent to a server.

Related Tools