JWT Generator

Create signed JSON Web Tokens for testing with HS256, RS256 or ES256, using your key or a generated one.

Runs in your browser. Nothing is uploaded.

JSON claims
Token

For testing and development. Keys you generate here exist only in this browser tab, so copy them before you leave.

How to use the JWT Generator

  1. Choose an algorithm. HS256 uses a shared secret, while RS256 and ES256 use a key pair.
  2. Edit the payload claims as JSON. Set iat to now and Expire in 1 hour fill in the timestamps for you.
  3. Enter a secret or private key, or press Generate a test secret to create one. For RS and ES, a matching public key is shown.
  4. Press Create token to sign it.
  5. Copy the token and use it in your API client, tests or local app.

Create signed JWTs for testing

When you’re building or debugging an API that uses JSON Web Tokens, you often need a token with exactly the right claims: a particular user, a role, a token that expires in 30 seconds, or one that’s already expired. Getting one from a real sign-in flow is slow and inflexible. This generator signs any payload you write, with the algorithm and key you choose.

Supported algorithms

  • HS256, HS384, HS512: HMAC with a shared secret
  • RS256, RS384, RS512: RSA signatures (PKCS#1 v1.5) with a private key
  • ES256, ES384: ECDSA on the P-256 and P-384 curves

Signing uses your browser’s built-in Web Crypto API, the same implementation used for HTTPS.

Keys made easy

Press Generate a test secret to create a strong random secret for HS algorithms, or a fresh key pair for RS and ES algorithms. For key pairs, the public key is shown in PEM format, ready to configure in the API that will verify your tokens. Or paste your own secret or PKCS#8 private key.

Claims made easy

The payload starts with common claims, sub, name, role, iat and exp, which you can edit freely. Buttons set iat to the current time and exp to one hour from now, so you don’t need to calculate Unix timestamps by hand. Invalid JSON is caught before signing, with the line and column of the mistake.

Check your work

Paste the result into the JWT Decoder to see the decoded claims and verify the signature. Remember that test tokens are real tokens. If your API accepts them, protect them like passwords.

Frequently asked questions

What is this tool for?

Creating JWTs for development and testing, such as calling a local API, writing automated tests, reproducing a bug with specific claims, or learning how tokens are built. Production tokens should be issued by your authentication server.

Which algorithm should I choose?

Use the one your API expects. HS256 is common for single services that share a secret. RS256 and ES256 let many services verify tokens with a public key while only the issuer holds the private key. ES256 tokens are shorter.

How long should a test secret be?

For HS256, at least 32 random bytes (256 bits). The generated test secret is exactly that length, encoded in Base64URL. Short or guessable secrets can be brute-forced from a single token.

Are my keys stored anywhere?

No. Keys exist only in the page while it's open, and signing uses your browser's Web Crypto. Nothing is sent or saved, so copy anything you want to keep.

Can I use a private key from my server?

Yes, if it's an unencrypted PKCS#8 PEM key (-----BEGIN PRIVATE KEY-----). It never leaves your browser, but avoid pasting production keys into any web page as a matter of habit.

Tutorials