# JWT Generator

Generate JWT tokens with custom claims and algorithms

> Canonical page: https://elysiatools.com/en/tools/jwt-generator

- **Category:** Security

- **Keywords:** jwt, generator, token, json, web, auth, create, encode

## Overview

The JWT Generator is a secure utility designed to create JSON Web Tokens (JWT) for authentication and data exchange. It allows developers to define custom claims, select signing algorithms, and set token expiration times, ensuring precise control over your application's security credentials.

## Inputs

- **Secret Key** (text): Enter a strong secret key (min 8 characters)
- **Algorithm** (select)
- **Issuer (iss)** (text): Optional: Token issuer (e.g., "my-app")
- **Audience (aud)** (text): Optional: Token audience (e.g., "my-users")
- **Subject (sub)** (text): Optional: Token subject (e.g., "user-id")
- **Expires In (seconds)** (number): Optional: Token lifetime in seconds (e.g., 3600 for 1 hour)
- **Custom Claims (JSON)** (textarea): Optional: Additional claims in JSON format Example: {"userId": 123, "role": "admin"}
- **Include JWT ID (jti)** (checkbox)
- **Include Issued At (iat)** (checkbox)
- **Include Not Before (nbf)** (checkbox)

## When to use

- Testing authentication flows in your web or mobile applications.
- Generating temporary access tokens for API development and debugging.
- Creating secure tokens with specific claims for microservices communication.

## How it works

- Enter a strong secret key to sign your token securely.
- Select your preferred HMAC algorithm (HS256, HS384, or HS512).
- Define standard claims like issuer, audience, and subject, or add custom JSON claims.
- Configure optional settings like expiration time and standard timestamps, then generate the encoded token.

## Use cases

- Simulating user authentication states during frontend development.
- Verifying backend API endpoints that require valid Bearer tokens.
- Generating short-lived tokens for secure inter-service authorization.

## Frequently asked questions

### Is my secret key stored on your servers?

No, this tool operates locally in your browser. Your secret key and token data are never transmitted or stored.

### Which algorithms are supported?

The generator supports HMAC SHA-256 (HS256), HMAC SHA-384 (HS384), and HMAC SHA-512 (HS512).

### Can I add custom data to the token?

Yes, you can include additional information in the 'Custom Claims' field using valid JSON format.

### What is the purpose of the 'Expires In' field?

It sets the 'exp' claim, defining the duration in seconds after which the token will be considered invalid.

### Are these tokens production-ready?

While the tokens are cryptographically valid, ensure you use a sufficiently long and complex secret key for production environments.

## Related tools

- [JWK Generator & Parser](https://elysiatools.com/en/tools/jwk-generator): Generate JSON Web Keys (JWK) for RSA, EC (P-256/P-384/P-521/secp256k1), and OKP (Ed25519/Ed448/X25519/X448), or parse an existing JWK to inspect its parameters, thumbprint, and metadata
- [Data URI Generator](https://elysiatools.com/en/tools/data-uri-generator): Convert files into Data URIs (Base64 or percent-encoded) for inlining images, fonts, and assets directly into HTML, CSS, or Markdown
- [Markdown Table Generator](https://elysiatools.com/en/tools/markdown-table-generator): Generate formatted Markdown tables from CSV, JSON, or array data with alignment, header styles, width control, and merge hints
- [OpenAPI to TypeScript Generator](https://elysiatools.com/en/tools/openapi-to-typescript-generator): Convert OpenAPI or Swagger JSON/YAML specs into TypeScript API types, request payloads, and response models with configurable output and naming styles
- [Pivot Table Generator](https://elysiatools.com/en/tools/pivot-table-generator): Generate interactive pivot tables from CSV/JSON data with customizable row, column, and value field configurations
- [Color Token Cascade Generator](https://elysiatools.com/en/tools/color-token-cascade-generator): Turn one primary hex color into a full design-token cascade with primary, accent, neutral, semantic tokens, CSS variables, and Style Dictionary JSON
- [Fitness Workout PDF Generator](https://elysiatools.com/en/tools/fitness-workout-pdf-generator): Generate a printable workout-plan PDF from JSON or CSV data with exercise tables, progress boxes, and optional QR video links
- [Gantt Chart Generator](https://elysiatools.com/en/tools/gantt-chart-generator): Create professional Gantt charts with task timelines, dependencies, progress tracking, and milestone markers

## Samples

- [JWT Samples](https://elysiatools.com/en/samples/jwt-samples): Comprehensive JWT examples from basic token structure to advanced security implementations
- [Terraform Plan JSON Samples](https://elysiatools.com/en/samples/terraform-plan-json-samples): Sample Terraform plan JSON files exported from terraform show -json style payloads for dependency visualization and change review
- [Hex/Unicode Encoding Format Samples](https://elysiatools.com/en/samples/text-hex-unicode-formats): Examples of hex (\xXX) and unicode (\uXXXX) escape sequence encoding formats
- [WebRTC Real-Time Communication Samples](https://elysiatools.com/en/samples/webrtc-samples): Comprehensive WebRTC samples for peer-to-peer audio/video communication, data channels, screen sharing, and signaling server implementation

## Related content

- [JWT Construction and Security Review](https://elysiatools.com/en/hubs/jwt-construction-and-security-review): Build a controlled JWT fixture or inspect an authorized sample, then review claims, algorithms, expiry, sensitive fields, and signature evidence without confusing decoding with verification.
- [Authorized JWT, OTP, TOTP, and Session Test Workflow](https://elysiatools.com/en/hubs/token-session-and-2fa-workflows): Build sanitized auth fixtures, separate token generation from decoding and verification, test OTP/TOTP timing, and audit JWT and session evidence without exposing real secrets.
- [Credential and JWT Security Workflow](https://elysiatools.com/en/hubs/auth-token-security): Generate or validate password credentials and inspect JWT security signals without treating key pairs as passwords.
