MyDevTools

JWT Encoder

Create and sign JSON Web Tokens (JWT) directly in your browser. Supports HS256, HS384, and HS512 algorithms with custom secret keys.

Need to decode a token? → Go to JWT Decoder

Header

Payload

Signature

Encoded Token

The JWT Encoder is a secure, client-side tool for generating JSON Web Tokens. It allows developers to create signed tokens for testing authentication flows, debugging API integrations, or learning about JWT structure.

Detailed Functionality

JSON Web Tokens (JWT) are an open, industry standard RFC 7519 method for representing claims securely between two parties. This tool allows you to:

  • Define Header & Payload: Customize the JSON data for both parts.
  • Sign Tokens: Apply HMAC SHA signatures (HS256, HS384, HS512) using your own secret.
  • Real-time Generation: The token updates instantly as you type.
  • Privacy: All signing happens in your browser via WebAssembly/JS. Your secrets never leave your device.

Practical Examples

Example 1: Basic User Token

Payload: `{"sub": "123", "name": "Alice", "admin": true}`

Secret: `mysecret`

Example 2: Expiring Token

Payload: `{"exp": 1735689600}`

(Sets expiration time)

How to Use This Tool

1. Edit the Header JSON (usually defaults are fine).

2. Modify the Payload JSON with your claims (user ID, roles, etc.).

3. Select a signing Algorithm (e.g., HS256).

4. Enter a Secret Key to sign the token.

5. Copy the generated Encoded Token.

Tips and Best Practices

  • Use a strong, long secret key for production tokens.
  • Ensure your JSON is valid; the tool will warn you if syntax is incorrect.
  • Never put sensitive data like passwords in the payload, as it can be decoded by anyone.
No data is sent to the server