JWT Generator

JWT Generator

Generate JWT tokens locally with JSON header and payload editors, HS256 signing, and unsigned test-token support. Perfect for authentication mocks, API integration testing, and local development workflows without external services.

jwt
token
security
Share this tool:
Quick Presets
Load common signed and unsigned JWT examples, then adjust the header, payload, and signing secret.
Input & Settings
Generate test JWTs locally from JSON header and payload objects using either `alg: none` or HS256 signing.
How it works: The generator serializes your header and payload JSON, base64url-encodes both segments, then optionally signs the token with HS256 using Web Crypto. Everything happens locally in your browser.

Complete Guide: JWT Generator

Everything you need to know about using this tool effectively

What is JWT Generator?

The JWT Generator creates JSON Web Tokens with custom header, payload, and signature. You enter claims (issuer, subject, expiration, custom fields), select a signing algorithm, and the tool produces a valid JWT string. It supports HS256, HS384, and HS512 algorithms. All processing happens in the browser.

This tool Base64-encodes the header and payload JSON, then signs them using the selected HMAC algorithm with a secret key you provide. The output is a three-segment JWT string.

Key Features
HS256, HS384, HS512 signing algorithms
Custom claims (iss, sub, aud, exp, iat)
Additional custom payload fields
Adjustable expiration time
Copy JWT to clipboard
Error messages for invalid input
Runs in the browser with no uploads
Real-time generation
Common Use Cases
When and why you might need this tool

Testing authentication endpoints

Generate JWTs with specific claims to test API authentication middleware.

Creating mock tokens for development

Generate tokens with test user data for frontend development without a backend.

Debugging token-based auth

Create a token with known claims to compare with tokens produced by your application.

Learning JWT structure

Build JWTs to understand how claims, algorithms, and signatures work together.

How to Use This Tool
Step-by-step guide to get the best results
1

Enter claims

Fill in issuer, subject, expiration, and any custom claims.

2

Enter a secret key

Type the HMAC secret key for signing.

3

Select algorithm

Choose HS256, HS384, or HS512.

4

Generate

Click Generate. The tool creates a signed JWT.

Pro Tips
1

HS256 is the most common algorithm for symmetric signing.

2

Set expiration (exp) to a future Unix timestamp.

3

The secret key must match what your server uses for verification.

4

Generated tokens are for testing. Use proper key management in production.

Frequently Asked Questions
What algorithms are supported?

HS256, HS384, and HS512 (HMAC with SHA-256, SHA-384, and SHA-512).

Is my token or key sent to a server?

No. All generation and signing happens in your browser. Nothing is transmitted.

Can I add custom claims?

Yes. Add any JSON key-value pairs to the payload beyond the standard claims.

How do I set the expiration?

Enter the expiration as a Unix timestamp (seconds since epoch), or use the time picker to set it relative to now.

Is this suitable for production?

No. This tool is for testing and development. Production JWTs should be generated by a secure server with proper key management.