# JWT Generator

Generate JWT tokens with custom claims and algorithms

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

- **Category:** Security

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

## Overview

Generate signed JSON Web Tokens (JWT) instantly using customizable HMAC algorithms and payload claims. This tool allows developers to configure standard header fields, timestamps, and custom JSON payloads to create secure authentication tokens for local development, API testing, and debugging.

## 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)
- **Output JWT Only** (checkbox): Output the bare JWT string (default, workflow-friendly). Uncheck for the detailed report with token details and security notes

## When to use

- Mocking authenticated requests to test backend endpoints in Postman, cURL, or local test suites.
- Debugging signature verification issues across HMAC algorithms like HS256, HS384, and HS512.
- Prototyping custom claim schemas with role-based access control data before implementing authorization services.

## How it works

- Enter a signing secret key (minimum 8 characters) and select the desired HMAC algorithm (HS256, HS384, or HS512).
- Specify standard claims such as Issuer (iss), Subject (sub), Audience (aud), and token lifetime in seconds (exp).
- Provide optional custom payload attributes formatted as valid JSON and toggle timestamp claims like iat, nbf, or jti.
- Click generate to produce a bare compact JWT string or a formatted report detailing token headers, payload, and signature.

## Use cases

- Generating short-lived bearer tokens to test OAuth2/OIDC consumer services and API gateways.
- Creating mock administrative tokens with elevated permission arrays for role-based frontend route testing.
- Simulating future-valid tokens using the Not Before (nbf) claim to test clock-skew tolerance and activation guards.

## Frequently asked questions

### Which signing algorithms are supported?

The generator supports HMAC-based symmetric signing algorithms: HS256 (SHA-256), HS384 (SHA-384), and HS512 (SHA-512).

### What is the minimum requirement for the secret key?

The secret key is mandatory and must contain at least 8 characters to ensure standard cryptographic strength.

### How are expiration (exp) and issued-at (iat) timestamps handled?

If an expiration value in seconds is provided, the tool calculates the Unix epoch timestamp by adding those seconds to the current time. The iat claim records the exact timestamp of token creation when enabled.

### Can I include nested objects or arrays in custom claims?

Yes, any valid JSON structure entered in the Custom Claims field is parsed and merged into the JWT payload.

### What is the difference between bare output and the detailed report?

Enabling 'Output JWT Only' returns just the compact three-part token string (header.payload.signature), while disabling it outputs decoded headers, claims, and security details.

## Related tools

- [Data URI Generator](https://test.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
- [Fitness Workout PDF Generator](https://test.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://test.elysiatools.com/en/tools/gantt-chart-generator): Create professional Gantt charts with task timelines, dependencies, progress tracking, and milestone markers
- [Milestone Chart Generator](https://test.elysiatools.com/en/tools/milestone-chart): Generate project milestone charts with timeline nodes and key achievement points
- [Multi-level Pie Chart Generator](https://test.elysiatools.com/en/tools/multi-level-pie-chart-generator): Create concentric multi-level pie charts with hierarchical relationships and interactive drill-down functionality
- [PDF Receipt / Ticket Generator](https://test.elysiatools.com/en/tools/pdf-receipt-ticket): Create a thermal-width receipt PDF with bold title and QR code
- [Pictograph Generator](https://test.elysiatools.com/en/tools/pictograph-generator): Create pictographs using icons/symbols to represent quantities with customizable icons, colors, and layouts
- [Range Chart Generator](https://test.elysiatools.com/en/tools/range-chart-generator): Create range charts to visualize min-max value ranges with median markers and outlier detection

## Samples

- [JWT Samples](https://test.elysiatools.com/en/samples/jwt-samples): Comprehensive JWT examples from basic token structure to advanced security implementations
- [Hex/Unicode Encoding Format Samples](https://test.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://test.elysiatools.com/en/samples/webrtc-samples): Comprehensive WebRTC samples for peer-to-peer audio/video communication, data channels, screen sharing, and signaling server implementation
- [Web Data Serialization Go Samples](https://test.elysiatools.com/en/samples/web-serialization-go): Web Go data serialization examples including JSON encoding/decoding and XML parsing

## Related content

- [JWT Construction and Security Review](https://test.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://test.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://test.elysiatools.com/en/hubs/auth-token-security): Generate or validate password credentials and inspect JWT security signals without treating key pairs as passwords.
