JWT Generator
Create HS256, HS384 or HS512 JWTs from header/payload JSON and a secret.
How to Use
- Paste or type your text into the JWT Generator input area above.
- Configure any format or mode options to generate the result in real time.
- Click Copy to copy the formatted result to your clipboard, or Reset to clear the workbench.
What is JWT Generator?
JWT Generator constructs signed JSON Web Tokens (header.payload.signature) from customizable Header JSON, Payload JSON, a secret key, and a selectable HMAC-SHA algorithm (HS256, HS384, or HS512). Backend developers and security engineers use it to mint test authentication tokens during API development.
How It Works
Given valid Header JSON, Payload JSON, a non-empty secret, and an algorithm choice (HS256, HS384, or HS512), generateJwt() in _shared/crypto.ts validates the JSON objects, Base64URL-encodes header and payload (TextEncoder + URL-safe btoa without = padding), signs header.payload via crypto.subtle.importKey + crypto.subtle.sign("HMAC", ...) using the matching SHA digest, and concatenates the Base64URL signature locally.
Common Use Cases
- Minting integration test tokens — create valid HS256, HS384, or HS512 JWTs with custom sub, role, and exp claims
- Testing signature strength tiers — switch between HS256 (SHA-256), HS384 (SHA-384), and HS512 (SHA-512) quickly
- Debugging custom JWT headers — edit alg, typ, or kid fields directly in the Header JSON editor
- Protecting HMAC signing secrets — compute Web Crypto signatures strictly inside your browser without network requests
Technical Details
API: Web Crypto crypto.subtle.importKey & crypto.subtle.sign via generateJwt() in _shared/crypto.ts. Supported algorithms: HS256, HS384, HS512. Uses UTF-8 Base64URL encoding without padding (-/_). Requires non-empty secret; runs locally.
FAQ
Is this JWT Generator free?
Yes, completely free. No signup required.
Does this tool upload my data?
No. All processing happens locally in your browser. Your data never leaves your device.