JWT Generator

Build and sign JSON Web Tokens with a custom header, payload, and secret. All signing happens locally — nothing leaves your browser.

HS256 / HS384 / HS512Live generationNo data stored
Have a token already?Decode it instead

Keep your secret private. Never expose it in client-side code or version control.

Fill in the fields above to generate a token

What is a JWT Generator?

A JWT generator creates signed JSON Web Tokens from a payload you define and a secret or key you provide. JWTs are used to securely transmit information between parties as a compact, self-contained token. The generator lets you specify standard claims like expiry (exp), issuer (iss), and subject (sub), add custom claims, choose a signing algorithm (HS256, RS256, etc.), and immediately get a token you can use for testing or development without spinning up an auth server.

Common Use Cases

  • Generate test tokens with specific roles or claims for local API development
  • Create tokens with custom expiry times to test token refresh logic
  • Prototype authentication flows before integrating a real identity provider
  • Reproduce authentication bugs by generating tokens with exact claim values
  • Learn the JWT structure hands-on by editing payloads and observing the encoded output

How It Works

The tool Base64URL-encodes the header JSON and payload JSON, concatenates them with a dot, then signs the result using the selected algorithm. For HMAC algorithms (HS256/HS384/HS512) the SubtleCrypto.sign() API signs with your provided secret. The resulting signature is Base64URL-encoded and appended as the third segment. All signing happens in your browser — the secret never leaves your machine.

Frequently Asked Questions

Is it safe to use this tool with real secrets?

Signing runs in your browser and nothing is transmitted, but treat production secrets with care. For sensitive environments, prefer generating tokens locally with a library like jsonwebtoken (Node.js) rather than any online tool.

What is the difference between HS256 and RS256?

HS256 uses a shared secret (HMAC-SHA256) — both the issuer and verifier need the same key, so it is only suitable when you control both sides. RS256 uses an RSA private key to sign and a public key to verify — the public key can be shared freely, making it suitable for public-facing APIs.

What should I put in the payload?

Include only the claims your application needs: user ID, roles, expiry, and issuer. Avoid storing sensitive data (passwords, PII) in the payload — JWT payloads are Base64-encoded, not encrypted, so anyone with the token can read them.

How JWT signing works: A JWT is assembled from a Base64URL-encoded header and payload, joined by a dot. The HMAC algorithm then signs this string using your secret key, producing the signature — the third segment. Tampering with the header or payload invalidates the signature.

Signing uses the browser's native crypto.subtle Web Crypto API. Your secret and payload never leave your device.