Guide

Create a Test JWT: HS256, RS256, ES256 and EdDSA

Short answer: to create a test JWT, edit the header and payload as JSON in the JWT Generator, choose an algorithm, enter a secret or key, and the token is signed in your browser with the Web Crypto API and updates as you type. It supports HS256/384/512, RS256/384/512, PS256/384/512, ES256/384/512 and EdDSA, and can generate a fresh key pair. Use it for development, testing and learning, never with a real production secret.

Which algorithm?

  • HS256, HS384, HS512 use one shared secret to sign and to verify. Keep the secret private on both sides.
  • RS, PS and ES algorithms and EdDSA sign with a private key. Give the matching public key to whoever verifies the token, never the private key.
  • PS256/384/512 is RSA-PSS, a different signature scheme from RS256 even with the same RSA key.
  • EdDSA here means Ed25519 and needs a browser that supports it in Web Crypto. The option is turned off with a note where it does not.

HS256 is a keyed hash; to see how that works, read HMAC vs hash.

A token you can verify yourself

With the header {"alg":"HS256","typ":"JWT"}, the payload {"sub":"123","name":"Ada"}, the secret example-secret and "Set iat automatically" switched off, the generator produces:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjMiLCJuYW1lIjoiQWRhIn0.wxsctKD2sGEqeTH_sUNwc8yG91LrzW-iYS8caXl4afc

It matches an independent HMAC-SHA256 over the first two parts, which is a good way to check any signing tool. In the JWT Decoder with the same secret it reports "Signature verified"; with a different secret, "Signature verification failed".

Why the token changes every time

By default the issued-at claim (iat) is set to the current time, so each token differs. Switch that option off for a fixed token. The header's alg is set automatically from your choice, and typ defaults to JWT.

Keys

"Generate new key pair" creates an RSA, RSA-PSS, EC or Ed25519 pair on your device, and nothing is uploaded. The key box accepts a PKCS8 PEM private key or a private JWK, and "Hide key text on screen" masks it visually without changing the value. For production keys, use proper key-management tooling, and remember that anyone who knows the signing key can issue valid tokens. To inspect a PEM, see the certificate guide.

A JWT does not hide its contents

The header and payload are only Base64URL-encoded, so anyone can read them. The signature shows they were not changed, but it does not hide them. See Base64 is not encryption, and for reading and verifying a token, the JWT guide.

How to create a test JWT with the JWT Generator

  1. Open the JWT Generator.
  2. Edit the header and payload.
  3. Choose the algorithm and enter a secret, or generate a key pair.
  4. Copy the token and check it in the JWT Decoder.

Limits to know

  • For testing and learning only.
  • Never paste a real production secret into any online tool.
  • Everything runs in your browser.

Frequently asked questions

Where is the token signed? In your browser, with the Web Crypto API.

HS256 or RS256? HS256 uses one shared secret. RS256 uses a private key to sign and a public key to verify.

Does a JWT hide its contents? No.

Why does my token change every time? The iat claim is set automatically.

Which key do I give to a verifier? The public key, never the private one.

Related tools and guides