ToolDash
JWT Token Generator

JWT Token Generator

Write a JSON payload, pick an HMAC algorithm, enter your secret and get a signed JSON Web Token. Signing uses your browser's Web Crypto API, so the secret never leaves your machine.

  • Free, no sign-up
  • Runs in your browser — nothing is uploaded
  • Instant results, no waiting on a server

Create JWT tokens by editing the payload, choosing an algorithm, and providing a secret key.

Add a JSON payload (or click Load Sample) to enable Generate.

Algorithm

Payload (JSON)
Generated JWT

Click "Generate JWT" to create a signed JSON Web Token.

No token generated

How to generate a JWT

  1. 1Pick the signing algorithm: HS256, HS384 or HS512.
  2. 2Enter your signing secret in the Secret Key field. Use the eye icon to show or hide it.
  3. 3Write your claims in the Payload (JSON) editor, or click Load Sample for a starting payload. Click Insert iat/exp to set iat to now and exp to one hour from now.
  4. 4Click Generate JWT. The signed token appears in the Generated JWT panel; click Copy JWT to put it on your clipboard.

How HMAC-signed JWTs work

A JWT is built from three parts. The header, here {"alg": "HS256", "typ": "JWT"} or the HS384/HS512 equivalent, and your payload are each serialized to JSON and Base64URL-encoded. The two strings are joined with a dot, and that signing input is run through HMAC with the selected SHA-2 hash and your secret. The resulting signature is Base64URL-encoded and appended as the third segment. That's why a JWT encoder needs your secret: Base64URL encoding alone would produce an unsigned token that no verifier should accept.

HS256, HS384 and HS512 are symmetric algorithms: the same secret signs and verifies. That makes them simple to set up when one backend both issues and checks tokens, but every service that verifies the token must hold the secret, and any of them could mint new tokens with it. When separate services need to verify tokens they shouldn't be able to issue, use an asymmetric algorithm like RS256 or ES256 instead. This JWT generator supports the HMAC family only.

Secret strength matters more than the choice between 256, 384 and 512. RFC 7518 requires an HMAC key at least as long as the hash output, so 32 random bytes for HS256. A short or guessable secret like "secret" can be brute-forced offline from a single captured token. Also note that the secret is used exactly as typed, as UTF-8 bytes. If your backend stores its key Base64-encoded and decodes it before signing, tokens from here won't verify unless you account for that.

For the payload, stick to the registered claims where they fit: sub for the user ID, iat and exp as Unix timestamps in seconds, plus iss and aud if your verifier checks them. Remember that the payload is readable by anyone who has the token, so keep it to identifiers and permissions, never secrets.

When developers reach for it

Testing protected endpoints

Create JWTs with specific roles or scopes to call your API from curl, Postman or an integration test.

Reproducing auth bugs

Generate tokens with an expired exp or a missing claim to check that your middleware rejects them correctly.

Checking a shared secret

Sign a known payload with the secret from your config and compare the result with what your service produces.

Seeding local development

Use it as a JWT token builder for local services, mocks and fixtures instead of spinning up a full auth server. Set a far-off exp if the token needs to last.

Frequently asked questions

Is this only an HS256 JWT generator?

+

No. It signs with HS256, HS384 or HS512, which are HMAC with SHA-256, SHA-384 and SHA-512. Asymmetric algorithms like RS256 and ES256 are not supported.

Is my secret sent to a server?

+

No. The token is signed in your browser with the Web Crypto API, and neither the secret nor the payload is uploaded.

How long should an HS256 secret be?

+

At least 32 bytes (256 bits) of random data, per RFC 7518. A random string from a secret key generator works well; a dictionary word does not.

Why does my server reject the token?

+

The usual causes are a different secret, a different algorithm, an exp in the past, or a missing iss or aud claim the server requires. Also check whether your server treats its secret as Base64-encoded bytes, since this tool uses the secret as plain text.

Can I add custom header fields like kid?

+

Not currently. The header is always alg plus typ: "JWT". You can put any custom claims you want in the payload.

Should I use tokens from an online JWT creator in production?

+

Use them for development and testing. Production tokens should be issued by your backend, where the secret is stored securely and expiry is enforced consistently.