JWT Generator

Write the claims, pick an algorithm and a secret or key, and get a signed token. Keys and secrets are made and used on this device and never leave the page.

How it works

A JSON Web Token is a header and a set of claims, each written as JSON and encoded with Base64url, followed by a signature over both. This page builds the header from the algorithm you choose, encodes your claims, and signs the result with the browser’s own Web Crypto.

HS256, HS384 and HS512 sign with a shared secret: the same secret checks the token. The RS, PS, ES and EdDSA algorithms sign with a private key, and anyone can check the token with the matching public key. Make a new key pair creates one for you on this device; the private key fills the key box and the public key is shown so you can verify with it.

EdDSA (Ed25519) needs a browser whose Web Crypto has it: Chrome 137, Firefox 129 or Safari 17 and later. Where it is missing the option is turned off and the page says why. ES512 is not offered. Nothing you type, and no key the page makes, is sent anywhere.

How to use it

  1. 1 Pick the Algorithm.
  2. 2 Write the Claims (JSON). Use Add issued-at (iat) to stamp the current time, and Expires in to set exp to 15 minutes, 1 hour, 1 day or 7 days from now.
  3. 3 For HS algorithms, type a Secret or press Make a random secret. For the others, paste a Private key (PEM, PKCS#8) or press Make a new key pair and keep the Public key it shows.
  4. 4 Copy the Token. Paste it into the JWT Decoder to check it, or into the API you are testing.

Good to know

  • Use this for development and testing. Tokens for real users should be issued by your own auth server, which controls who gets them and for how long.
  • A token is only as safe as its key. Anyone with the HS secret or the private key can mint tokens your server will accept.
  • Give test tokens an exp. A token with no expiry stays valid until you change the key.
  • Make a random secret gives 32 random bytes, the size RFC 7518 asks for with HS256. A short password as a secret can be guessed offline from a single token.
  • If your key starts with BEGIN RSA PRIVATE KEY or BEGIN EC PRIVATE KEY, convert it first: openssl pkcs8 -topk8 -nocrypt -in key.pem.

Browser support

  • Chrome 94 and later · full speed from 137
  • Firefox 93 and later · full speed from 129
  • Safari 16.4 and later · full speed from 17
  • Edge 94 and later · full speed from 137

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Building the tutorial JWT from scratch, and what changes with a key pair

The token used in nearly every JWT tutorial is easy to rebuild here, which is a good way to see that signing involves no magic. Choose HS256 as the Algorithm. In Claims (JSON) write {"sub":"1234567890","name":"John Doe","iat":1516239022}, and type your-256-bit-secret as the Secret. The Token box shows eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c, character for character the token the tutorials print.

Here is where each piece comes from. The header is {"alg":"HS256","typ":"JWT"}, 27 bytes of JSON, which Base64url turns into the 36 characters eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. The claims are 55 bytes of JSON and become the 74 characters between the two dots. Those two strings joined by a dot are the signing input. The page computes HMAC-SHA256 of that input with the secret as the key, gets 32 bytes beginning 49 f9 4a c7, and writes them in Base64url as SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c. Change the name to Jane Doe and the middle part and the whole signature change; the header stays the same.

The order and spacing of the JSON matter. The signature covers the exact characters, so {"sub":"1"} and { "sub": "1" } give different tokens, both valid. That is why a server never re-encodes claims before checking a signature: it checks the text it was given.

Now switch the Algorithm to ES256 and press Make a new key pair. Your browser generates a fresh P-256 key on this device. The Private key (PEM, PKCS#8) box fills with the signing half, and the Public key appears below it. Sign the same claims and the third part of the token is now 86 characters: 64 bytes, made of two 32-byte numbers, r and s, side by side. RFC 7518 requires exactly that layout in a JWT, rather than the DER encoding OpenSSL prints, and it is what Web Crypto produces, so nothing is converted. Sign twice and you get two different signatures, because ECDSA uses a fresh random number each time; both verify.

This is the real difference between the two families. With HS256, whoever can check a token can also create one, because both use the same secret. With ES256, RS256, PS256 or EdDSA, you can hand the public key to every service that needs to check tokens and keep the private key in one place. Paste the token and the public key into the JWT Decoder and it reports Signature verified; paste the same token with a different public key and it does not.

Use what you make here for what it is good at: testing an API, reproducing a bug, learning the format. Real tokens should come from your own auth server, with short expiry times, which Expires in makes easy to practise. And treat the key with care. The page never sends it anywhere, but a token is only as trustworthy as the secret or private key behind it, so do not paste production keys into any web page, this one included, unless you are sure of the machine you are on.

Frequently asked questions

Are my keys and secrets sent to a server?

No. Keys are generated by your browser’s Web Crypto, tokens are signed in this page, and nothing is uploaded or stored. Close the tab and the keys are gone unless you copied them.

Should I use HS256 or RS256?

HS256 when the same service issues and checks tokens: it is simple and fast, but every checker holds the secret and could also mint tokens. RS256, ES256 or EdDSA when other services must check tokens: they get only the public key, which can verify but not sign.

Why is EdDSA greyed out?

Your browser’s Web Crypto does not have Ed25519 yet. It arrived in Chrome 137, Firefox 129 and Safari 17. Update the browser, or pick ES256, which every current browser supports.

Why is there no ES512?

ES512 uses the P-521 curve, which is rarely used in practice and not supported consistently across browsers. ES256 and ES384 cover almost every system that asks for ECDSA.

Why is my ES256 signature 64 bytes and not DER?

Because that is what JWS requires. RFC 7518 says an ECDSA signature in a JWT is the two numbers r and s, 32 bytes each for ES256, placed side by side. That is also what Web Crypto produces, so no conversion is needed.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.