JWT-Token-Generator
Create an HS256-signed JWT from header and payload JSON using a secret key.
How to Use
- Paste or type your text into the JWT-Token-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-Token-Generator?
Der JWT-Token-Generator builds standard three-part JSON Web Tokens signed with HMAC-SHA256 (HS256) from editable Header JSON, Payload JSON, and a shared signing secret. Developers use it to craft reproducible Bearer tokens for testing REST APIs, middleware guards, and local authentication flows.
How It Works
Pre-populated with standard {"alg":"HS256","typ":"JWT"} header and sample claims, clicking Generate JWT validates that the secret is present and invokes generateJwt(header, payload, secret, "HS256") in _shared/crypto.ts. It validates JSON syntax, Base64URL-encodes header and payload with UTF-8 TextEncoder, and signs the compact token via Web Crypto HMAC-SHA256 locally.
Common Use Cases
- Testing local Express, FastAPI, or Cloudflare Workers auth — generate HS256 tokens matching your dev secret in seconds
- Verifying expired or future exp/nbf claims — customize numeric timestamp claims in Payload JSON to test boundary checks
- Checking canonical Base64URL encoding — produce RFC 7519 dot-separated tokens with zero padding characters
- Keeping signing secrets private — execute HMAC-SHA256 key import and signing locally via crypto.subtle
Technical Details
Algorithm: fixed HS256 (HMAC with SHA-256) via Web Crypto crypto.subtle in generateJwt(). Encodes UTF-8 header and payload JSON to unpadded Base64URL (+->-, /->_). Validates JSON parseability and non-empty secret locally.
FAQ
Is this JWT-Token-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.