JWT Generator
Generate signed JSON Web Tokens (JWT) using HMAC-SHA256 signing with custom or default JSON payloads.
Run tool
This online JWT generator creates signed JSON Web Tokens for development, prototyping, and testing workflows. The tool accepts an optional JSON payload, an optional shared secret, and an algorithm label. If you leave the payload input blank, the generator automatically supplies a standard default JSON structure containing typical claims. When you provide custom payload text, ensure it uses valid JSON syntax with proper quotes and braces. You can configure your own secret string to sign the token or leave the field set to its default value. The generator signs the token data using HMAC-SHA256 and sets the algorithm label in the token header. After you run the generator, the output panel displays a compact token string composed of three dot-separated sections representing the encoded header, payload, and signature. You can copy the generated token directly into your HTTP headers, API clients, or test suites.
Instructions
- Enter your custom claims as formatted JSON in the payload field, or leave it blank to use the built-in default payload.
- Optionally enter a custom secret key in the secret field, or keep the default secret string.
- Optionally adjust the algorithm header label, which defaults to HS256.
- Run the generator to create your signed token.
- Copy the three-part token string from the output panel to use in your HTTP headers, API clients, or test configurations.
Examples
- Default token generation: Leave the payload, secret, and algorithm fields at their default values to generate a standard sample token signed with 'my-secret'.
- Custom user claims: Enter {"sub": "usr_9812", "role": "admin", "iss": "auth-service"} in the payload field and specify a custom secret key to generate a signed role token for API endpoint testing.
FAQ
What happens if I leave the payload field empty?
When the payload field is left blank, the generator automatically applies a built-in default payload structure to generate the token.
What signing method does this generator use?
The generator uses HMAC-SHA256 to sign the token data. The algorithm field sets the identifier that appears in the token header.
Why does token generation fail with my custom payload?
If token generation fails, check that your payload text is valid JSON. Common issues include missing quotation marks around property names, single quotes instead of double quotes, or trailing commas.
Does this tool verify or decode existing JWT tokens?
No. This tool is designed specifically for creating and signing new tokens from input data rather than decoding or validating pre-existing tokens.