🏷 JWT Generator

Mint signed HS256, HS384, or HS512 test tokens with the WebCrypto API on this page, so the secret you type never reaches a server.

Last updated: November 8, 2026 · By the BoltQuickTools team

click to copy after generating

Minting a signed test token for your API

Testing an endpoint that requires a JWT usually means logging in through the real flow just to get a token, and even then you cannot easily try an expired one or a different role. This page signs a token with whatever claims you choose, using HMAC and a shared secret, so you can paste it into curl, Postman or a test.

Building a token

  1. Edit the JSON in Header and Payload (Claims). The preset buttons user session, api access, refresh token and minimal replace the payload with a common shape.
  2. Enter the key in Secret (HMAC key) and choose HS256, HS384 or HS512 under Algorithm.
  3. Optionally set Auto-set iat + exp to +1 hour, +1 day, +1 week or +30 days. Leave it on Manual to keep your own timestamps.
  4. Click Generate Token, then click the Token box to copy it. There is no copied message.

Changing a preset, the algorithm or the secret does not update the token by itself. Click Generate Token again each time.

Exact output for known inputs

HMAC is deterministic, so these inputs always produce these tokens. With Manual timing, HS256, the header {"alg":"HS256","typ":"JWT"}, the payload {"sub":"user_123"} and the secret test-secret-please-change:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyJ9.8DnRzwf4tV5pNKq3XQP66FBaHhf0WogkXymcSyLM67Y

Switch to HS512 and both the first and last segments change:

eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyJ9.e-bxqwDeBEF65Um3yAt2LbeDnF6_2G7_YJ8GDsp7ciSnJKBNCkRG0qayxMKM_weSSPlor64u1IE7uw6fQmp9wA

A verifier configured with the same secret and algorithm should accept these, which makes them handy for checking that a library is set up correctly. Libraries that enforce the minimum key length described below may refuse this 25-byte secret.

Behaviour worth checking before you rely on a token

RS256, ES256 and other asymmetric algorithms are not available. To inspect the result, paste it into the JWT decoder. To compute a signature for other kinds of message, use the HMAC generator. Passwords need a different approach entirely, which the password hashing guide explains.

Questions about signing here

Why does my server say the signature is invalid?

Check three things: the algorithm matches, the secret has no stray whitespace or newline, and the server is not base64-decoding its key. The signature covers the exact encoded header and payload, so re-serialising the JSON elsewhere will not match.

Can I use a production secret on this page?

Signing runs through crypto.subtle in your browser, and the page's own script sends nothing over the network. Even so, the page also loads analytics, plus ads if you accept them, and a production signing key should not be typed into any web page. Use a throwaway secret for testing.

Can I test how my API handles an expired token?

Yes. Leave the timing on Manual and set exp to a past Unix time. The sample payload already does this.