Skip to content
Jellykit

JWT Generator

Build and sign JSON Web Tokens with HS256, HS384, HS512, RS256, PS256, ES256 or EdDSA from your claims and key.

  • Runs on your device
Loading tool

About JWT Generator

Write the claims as JSON, choose an algorithm, and get a signed JSON Web Token ready to paste into an API client or a test. Issued-at and expiry times can be added for you, and a key ID goes in the header when you give one.

Sign with your own shared secret or PKCS#8 private key, or let the tool create a throwaway key and show you the secret or public key needed to verify the token. Signing uses the browser’s Web Crypto API; neither the claims nor the key leave this page.

How it works

  1. The payload is parsed as a JSON object. If asked, iat is set to the current time and exp to that time plus the minutes you choose, both in whole seconds as the JWT standard requires.
  2. The header is {"alg", "typ": "JWT"} plus kid when given. Header and payload are Base64url-encoded and joined with a dot.
  3. That text is signed with HMAC for the HS algorithms, RSASSA-PKCS1-v1_5 or RSA-PSS for RS256 and PS256, ECDSA P-256 for ES256 and Ed25519 for EdDSA, using the jose library on top of Web Crypto.
  4. A throwaway key is made once per algorithm and kept until you leave the page, so editing the claims does not change the key you are verifying with.

Questions

Which key formats can I paste?

For HS algorithms, a secret as plain text or Base64. For the others, an unencrypted private key in PKCS#8 PEM form (BEGIN PRIVATE KEY). PKCS#1 and SEC1 keys are recognised and you are shown the openssl command that converts them.

Should I paste a production signing key here?

The key is used only in this page’s memory and is never sent or stored. Even so, a production key should stay on the systems that need it; use a test key or the throwaway key for experiments.

Why does it warn about my HMAC secret?

RFC 7518 requires an HMAC key at least as long as the hash: 32 bytes for HS256, 48 for HS384 and 64 for HS512. A shorter secret still works, but it can be guessed offline from any token it signed.

Why does EdDSA fail in my browser?

Ed25519 signing arrived in browsers recently. Current versions of Chrome, Edge, Firefox and Safari support it; older ones do not, and the tool tells you so rather than producing a broken token.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.