JWT Generator
Create JSON Web Token with custom Header and Payload
What is JWT?
JWT (JSON Web Token) is an open standard (RFC 7519) for securely transmitting information between parties. JWT consists of three parts: Header, Payload, and Signature, separated by dots. JWT is commonly used for authentication and information exchange.
How to Use
JWT Generation Flow
- Select signing algorithm (default HS256)
- Enter or click "Generate" to create a signing secret
- Edit Payload JSON, use quick add buttons to add standard claims
- Set issued at (iat) and expiration (exp) time
- Click "Generate JWT Token" button
- Copy the generated Token for testing or development
Supported Algorithms
| Algorithm | Type | Description |
|---|---|---|
HS256 | Symmetric | HMAC SHA-256, most commonly used |
HS384 | Symmetric | HMAC SHA-384 |
HS512 | Symmetric | HMAC SHA-512 |
Examples
FAQ
Q: Is the generated JWT safe for production?
A: The JWT format is correct, but ensure you use a strong random secret (at least 32 characters) and set a reasonable expiration time. Keep the secret safe and never expose it.
Q: Why only HMAC algorithms?
A: This tool currently supports symmetric algorithms (HS256/HS384/HS512), suitable for most scenarios. RSA and other asymmetric algorithms require key pair management and will be supported in future versions.
Q: What do iat and exp do?
A: iat (Issued At) indicates when the token was issued, exp (Expiration) indicates when it expires. Servers can verify if the token is within its valid period.
Q: How to verify the generated JWT?
A: Use the JWT Decoder tool on this site, or verify the signature server-side using the same secret.