JWT Generator

Create signed JSON Web Tokens (JWT) online with HS256, RS256, PS256 or ES256 – set claims, expiry and key ID, or generate a new key pair.

Tool

Was this tool useful?

About this tool

About JWT Generator

Build a test token in seconds. Write the payload claims as JSON, choose the algorithm and sign with a shared secret (HS256/384/512) or a private key (RS, PS or ES). Issued-at and expiry times can be added for you, and a new random secret or RSA/EC key pair can be created right in your browser – the private key never leaves your device.

How it works

token = base64url(header) + "." + base64url(payload) + "." + base64url(signature). The signature is made with the browser’s Web Crypto API.

Example

HS256 with the payload {"sub":"123"} and a 32-byte secret gives a token of about 150 characters that any JWT library can verify.

How to use this tool

  1. Choose the algorithm and enter a secret, or paste a private key (or press “Generate key pair”).
  2. Write the payload claims in JSON and set the expiry.
  3. Press “Create token” and copy it.

Frequently asked questions

Is it safe to use this for production tokens?

Signing happens only in your browser and nothing is sent to a server. Still, never paste production private keys into any website – use this for testing and learning.

Which key formats work?

PKCS#8 (“BEGIN PRIVATE KEY”) and PKCS#1 RSA keys (“BEGIN RSA PRIVATE KEY”). EC keys must be PKCS#8. Password-protected keys are not supported.

How long should an HS256 secret be?

At least 32 random bytes (256 bits). “New secret” creates one for you.

Does the JWT Generator send my data to a server?

No. The JWT Generator runs entirely in your browser using JavaScript, so tokens, code and data you paste stay on your device. You can even use it offline once the page has loaded.