tooldura

All tools

JWT Generator

Build a token with your own claims and sign it with HS256, HS384 or HS512

Your own claims go here. Issued-at and expiry are filled in for you, so leave iat and exp out of this box unless you want to pin them to an exact second.

Algorithm

HMAC only. Signing RS256 or ES256 would mean pasting a private key into a web page, which is not a thing this site will ask you to do.

Secret encoding

19 bytes of key material. Everything is signed in your browser, so this secret never travels anywhere.

Heads up: HS256 wants at least 32 bytes of key, and this one is 19. A short secret can be brute-forced offline from any token you hand out, which recovers the key and lets anyone mint their own.
Signed token
Fix the payload and the signed token appears here.

About JWT Generator

The JWT Generator builds a signed token from claims you write yourself, for the moment you need a valid token to test an endpoint, a middleware or a login flow and do not want to run the whole issuer to get one. You write the claims, pick a lifetime, and iat and exp are filled in from the current second. Pick "Already expired" instead and you get the opposite: a token that ran out five minutes ago, issued an hour before that, for checking your service turns it away. Signing is HMAC through crypto.subtle, and the tool checks the key length against what RFC 7518 requires for the algorithm you picked, because a two-word secret is the difference between a signature and a formality.

FreeNo paywalls or tiers
No SignupNothing to create
InstantNo setup, no install
Any DeviceMobile, tablet, desktop

The guide behind this tool

Signing a JWT: Which Algorithm, and How Long the Key Has to Be

HS256 hands every verifier the power to forge. RS256 does not. And the 32-byte minimum in RFC 7518 is the line between a signature and a formality.

8 min read

How to use JWT Generator

  1. 1

    Write your claims as a JSON object. Anything is allowed: sub, a role, a tenant id, whatever the API you are testing reads.

  2. 2

    Pick HS256, HS384 or HS512, and choose how long the token should last.

  3. 3

    Type the secret your API verifies with, or generate a strong random one if you are creating both sides.

  4. 4

    Copy the token and send it as an Authorization header.

Frequently Asked Questions

Because signing RS256 or ES256 needs the private key, and pasting a production private key into a web page is a bad habit regardless of how the page behaves. HMAC uses one shared secret that you already have on both sides, so nothing is exposed that was not already. If you need an RS256 token, mint it where the private key lives; you can still bring the result here and verify it with the public key in the decoder.