JWT Generator and Signer

Build a JSON Web Token in your browser. Choose an HMAC algorithm, edit the paylo...

SecureFastFree

Updated

Signing settings

Signed entirely in your browser with the Web Crypto API. Your secret and payload never leave the page, are never uploaded, and are gone when you close the tab.

Expires in

A JWT payload is only Base64URL-encoded, not encrypted. Anyone can read it, so never put a password or an API key in a claim.

Quick answer

To generate a JWT, choose a signing algorithm (HS256, HS384, or HS512), type your secret, and write the payload as JSON. This tool Base64URL-encodes the header and payload, signs the header.payload string with your secret using the Web Crypto API, and shows the compact header.payload.signature token, all in your browser so nothing is uploaded. It updates live as you edit, has one-tap helpers to add the sub, iss, aud, iat, and nbf claims, and an expires-in picker that sets the exp and iat claims to the correct Unix epoch seconds. Copy the finished token, then paste it into the JWT Decoder to confirm the signature verifies with the same secret.

SSL Secured
256-bit Encryption
Cloud Processing
Mobile Friendly

Generator Features

Live Token Output - The signed JWT rebuilds instantly as you edit
HS256, HS384, HS512 - Choose the HMAC strength that fits your service
Expiry Picker - Set exp and iat from a window like 1 hour or 7 days
Claim Helpers - Add sub, iss, aud, iat, and nbf with one tap
Friendly JSON Errors - Invalid payload JSON is flagged, never crashes
One-Click Copy - Copy the token, header, or payload instantly

Why Use JWT Generator and Signer?

Live Signing as You Type

The compact token rebuilds the moment you change the payload, secret, or algorithm, so you always see the signed JWT without clicking a button.

Real HMAC Signatures

The signature is computed with the Web Crypto API using HS256, HS384, or HS512, so the token verifies correctly against your secret, not a fake placeholder.

Expiry in One Click

Pick a window like 1 hour or 7 days and the tool sets the exp and iat claims to the right epoch seconds for you, with a readable preview of when it lapses.

Editable Payload with Claim Helpers

Write any JSON payload by hand, or add sub, iss, aud, iat, and nbf with a tap. Invalid JSON gets a clear message instead of a crash.

Nothing Leaves Your Browser

Every token is built and signed on your device with JavaScript. Your secret and payload are never uploaded, logged, or stored, so it is safe for real keys.

Copy and Cross-Check

Copy the whole token, the header, or the payload with one click, then jump to the JWT Decoder to confirm the signature verifies with the same secret.

Common Uses for the JWT Generator

Test API Authentication

Create a signed token with the exact claims your API expects and send it as a Bearer header while developing.

Reproduce Auth Bugs

Build a token with a specific expiry or role to reproduce a 401 or a permission failure on purpose.

Seed Automated Tests

Generate deterministic tokens for integration and end-to-end tests that need a valid signed JWT.

Learn How Signing Works

See how a header and payload turn into a signed token to understand the JWT format from the inside.

How It Works

1

Pick the algorithm and secret

Choose HS256, HS384, or HS512, then type the shared secret the token will be signed with. HS256 is the most common choice.

2

Edit the payload and add claims

Write your claims as JSON, or use the helper buttons to add sub, iss, aud, iat, and nbf. Set an expiry with the duration picker.

3

Copy the signed token

The signed JWT updates live below the editor. Copy it and send it as an Authorization Bearer header, or decode it to double-check.

Tips and Security Notes

A JWT Is Not Encrypted

The payload is only Base64URL-encoded, so anyone with the token can read it. Never put a password, an API key, or other secrets in a claim.

Use a Strong Secret

For HS256, use a random string of at least 256 bits (32 characters). A short or guessable secret makes the signature easy to forge.

Sign Production Tokens Server-Side

Tokens built in a browser are ideal for testing. In production, sign on the server so the secret never ships in client code, and keep the expiry short.

Frequently Asked Questions

Pick a signing algorithm (HS256, HS384, or HS512), type your secret, and write the payload as JSON. This tool then Base64URL-encodes the header and payload, signs the header.payload string with your secret using the Web Crypto API, and shows the compact header.payload.signature token below the editor. It updates live as you type, and you copy it with one click. Everything runs in your browser, so the secret never leaves the page.
A generator builds and signs a new token from a header, payload, and secret, which is what this page does. A decoder does the reverse: it splits an existing token and reads the header and payload without a key. Use this generator to create test tokens, then paste them into the JWT Decoder to read the claims back and verify the signature matches your secret.
The exp claim is a number: seconds since 1 January 1970 (Unix time). Working that out by hand is error prone, so use the expires-in picker here: choose a window like 1 hour, 1 day, or 30 days and the tool sets exp and iat to the correct epoch values and shows the exact date the token will lapse. You can also add or edit exp directly in the JSON payload.
This tool signs with the HMAC family: HS256 (HMAC SHA-256), HS384 (HMAC SHA-384), and HS512 (HMAC SHA-512). These use one shared secret to both sign and verify, which covers the most common testing and development case. Asymmetric algorithms such as RS256 and ES256 need a private key pair and are usually generated server-side, so they are not offered here.
Yes, because nothing is sent anywhere. The Base64URL encoding and the HMAC signing both run in your browser with the built-in Web Crypto API. Your secret and payload never leave the page, are never uploaded, and are gone when you close the tab. That makes it safe to sign with a real secret, unlike tools that build the token on a server.
The signatures are real and will verify correctly, but generating tokens in a browser is meant for testing, learning, and development. In production you should sign tokens on your server with a secret that stays out of client code, keep the expiry short, and never place a password or an API key in the payload, since a JWT payload is only encoded, not encrypted.

Related Tools