Skip to content
M2TOOLKIT

Developer · free tool

JWT Generator

Create and sign a JSON Web Token for testing your API.

Use it as often as you like — it's free, with no sign-up and no limits.

  • Developer
  • Free
  • No sign-up
  • Nothing is sent or stored
  • Updated
Algorithm
minutes

Leave empty or 0 for no exp claim.

Signed with the Web Crypto API in your browser. Never paste production secrets into websites — use this for testing and learning.

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved.

How to use the JWT Generator

  1. Choose the signing algorithm.
  2. Edit the payload claims and set an expiry.
  3. Enter or generate a secret, then copy the signed token.

What does this tool do?

A JWT has three Base64URL parts: a header naming the algorithm, a payload of claims, and a signature. HMAC algorithms (HS256/384/512) sign with a shared secret that the server also knows.

Signing uses your browser's Web Crypto API, so the secret never leaves your device. Decode tokens with the JWT Decoder.

Why use it?

  • HS256, HS384 and HS512.
  • iat and exp claims added for you.
  • Random secret generator.

Use cases

  • Test protected API endpoints locally.
  • Create tokens with short expiry to test refresh flows.
  • Learn how JWTs are built.

What a token is made of

The header {"alg":"HS256","typ":"JWT"} encodes to eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. A dot, the encoded payload with claims like sub and exp, another dot, then the signature. Anyone can decode the first two parts, so never put secrets in them.

Common mistakes

  • Putting passwords or private data in the payload — it's only encoded, not encrypted.
  • Short, guessable secrets.
  • Using test secrets or tokens in production.

Accuracy and limits

  • For testing only. Don't paste production secrets into any website.

Privacy

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.

Frequently asked questions

What is exp?

The expiry time, as a Unix timestamp in seconds.

HS256 or RS256?

HS256 uses a shared secret; RS256 uses a private and public key pair. This tool signs HMAC tokens.

Is my secret sent anywhere?

No. Signing uses your browser's Web Crypto API.

Content last updated . See how M2Toolkit works.

Other tools people use alongside the jwt generator.