JWT Generator

Create signed JSON Web Tokens for testing your API: HS256 with a secret, or RS256, PS256, ES256 and EdDSA with a private key, plus iat, exp and jti claims.

min

0 = no exp claim

Also add

Enter a secret to sign the token: your server verifies it with the same secret.

For testing and development. Signing happens in your browser and nothing is sent anywhere, but never paste production secrets or keys into any website, including this one.

How to generate a JWT

  1. Pick the algorithm your API expects and, if it uses one, a key ID (kid).
  2. Write the claims as a JSON object. Set the expiry in minutes (0 for none) and choose whether to add iat and a random jti.
  3. Enter the secret for HS256/384/512, or paste a private key for the others. Make a test key pair creates one in your browser, with the public key to give your API.
  4. Select Generate token and copy it.

Example

With the payload {"sub":"1234567890","name":"John Doe","iat":1516239022}, the secret your-256-bit-secret, HS256, no expiry and iat unticked, the tool makes the same token as the well-known example on jwt.io, ending in …SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c.

Good practice

  • Keep tokens short-lived (minutes to hours) and check exp, aud and iss on the server.
  • Never put passwords or personal secrets in the payload: anyone holding the token can read it.
  • Keep signing secrets and private keys on the server; give other services only the public key.

Frequently asked questions

Is my secret or private key sent anywhere?

No. Signing runs in your browser with the Web Crypto API and nothing is uploaded. Even so, use test secrets and test keys here, never the ones that sign your production tokens.

Which algorithm should I use?

HS256 when the same service signs and checks tokens with one shared secret. RS256 or ES256 when other services must check tokens without being able to make them: they only need the public key, which identity providers publish as a JWKS. EdDSA (Ed25519) has small keys and signatures; check your library supports it.

How long should an HS256 secret be?

At least as long as the hash: 256 bits (32 bytes) for HS256, 384 bits for HS384 and 512 bits for HS512, as RFC 7518 requires. The tool warns when a secret is shorter, and Make a random secret creates one of the right length.

What do iat, exp and jti do?

iat records when the token was issued and exp when it expires, both in seconds since 1 January 1970 UTC. jti is a unique ID a server can use to refuse the same token twice. Values you type in the payload replace the ones the tool adds.

EdDSA or Ed25519?

Both mean an Ed25519 signature. RFC 9864 (October 2025) replaced the name EdDSA with Ed25519, but many libraries still expect EdDSA, so pick the one your verifier accepts.

How do I check a token I made?

Paste it into the JWT decoder with the same secret, or with the public key for RS, PS, ES and EdDSA tokens, to see the claims and confirm the signature.

More text and developer tools

See all text and developer tools →

Can't find the tool you need? Tell us.