Skip to main content

Free JWT Generator Online

JWT Generator builds and signs a JSON Web Token with HS256, HS384, or HS512 using the Web Crypto API in your browser. The secret never leaves your device.

Written & reviewed by Helperzy Editorial Team · Updated July 2026

Matches jwt.io default exampleChecking…

Claims

Payload preview

{
  "sub": "1234567890",
  "iat": 1516239022,
  "name": "John Doe"
}

100% Private

HS256/384/512 only (RS256 is out of scope). Signing uses the Web Crypto API — your secret never leaves the browser.

How to Use JWT Generator

1

Set the Header and Payload

Choose the signing algorithm in the header and enter your claims in the payload, such as a subject, a name, and an issued-at or expiry timestamp, using valid JSON for both sections.

2

Provide a Signing Secret

Type the shared secret used to compute the HMAC signature; a longer, high-entropy secret resists brute-force forgery. The secret is used locally through the Web Crypto API and is never sent anywhere.

3

Generate and Copy the Token

The tool base64url-encodes the header and payload, signs them, and joins the three segments with dots into a finished token you can copy and use as a bearer credential in requests.

Generate and Sign a JSON Web Token in Your Browser

A JSON Web Token is a compact, self-contained way to carry claims between two parties, and it is the backbone of stateless authentication across modern web services. A token has three parts joined by dots: a header describing the signing algorithm and token type, a payload holding the claims, and a signature that proves the first two parts were not tampered with. This generator builds all three, lets you choose an HMAC algorithm, and signs the result with a secret you provide. Crucially, it uses the browser's built-in Web Crypto API to compute the signature locally, which means the secret you type is used on your own machine and never leaves it. That local-only design is what makes it safe to experiment with real secrets while building or debugging an authentication flow. The token is assembled in a precise sequence. First the header, a small JSON object naming the algorithm and setting the type to JWT, is serialized and encoded with base64url — a variant of Base64 that swaps the two URL-unsafe characters for hyphen and underscore and drops the trailing padding so the value is safe inside a URL. The payload, your JSON object of claims, is encoded the same way. Those two encoded strings are joined with a dot to form the signing input. The generator then computes an HMAC over that signing input using the chosen hash and your secret key, and encodes the resulting bytes with base64url to produce the third segment. Joining header, payload, and signature with dots yields the finished token. The generator supports HS256, HS384, and HS512, the three HMAC algorithms that differ only in the underlying SHA hash size; asymmetric algorithms such as RS256, which sign with a private key and verify with a public one, are intentionally out of scope here because they need key-pair handling this tool does not provide. The standard reference example makes the process verifiable. Take the header naming HS256, a payload containing a subject of 1234567890, a name of John Doe, and an issued-at timestamp of 1516239022, and the secret your-256-bit-secret. Encoding the header gives the first segment, encoding the payload gives the second, and signing the joined pair with HMAC-SHA256 and that secret produces the third. The complete token comes out as eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c. If you change even a single character of the payload or use a different secret, the signature segment changes completely, which is exactly the property that lets a server detect tampering. This token is the canonical example from the JWT specification material, so you can paste it into any decoder to confirm the header and payload round-trip correctly. In practice the generator earns its place during development and testing. A backend developer building a protected endpoint can mint a valid token with the exact claims the API expects and drop it into a request header to test authorization logic without spinning up a full login flow. A QA engineer can generate tokens with different roles or an expiry claim to verify that permission checks and expiration handling behave correctly. Someone learning how tokens work can change a claim, regenerate, and watch the signature change, building intuition for why the signature binds to the content. It pairs naturally with a JWT decoder: generate a token here, decode it there, and see the exact bytes travel in both directions. A few points keep usage safe and correct. The signature guarantees integrity, not confidentiality — the header and payload are only Base64-encoded, not encrypted, so anyone with the token can read the claims. Never put a password or other secret inside a payload. Keep the signing secret genuinely secret and reasonably long; a weak secret makes an HMAC token easy to forge by brute force, which is why the example secret is labelled as a 256-bit value. Set an expiry claim on tokens meant for real use so a leaked token stops working, and remember that this tool produces tokens for development and testing rather than a production issuance pipeline. Because signing runs entirely through the Web Crypto API in your browser and nothing is uploaded, even a real secret used here stays on your own device, which is the reassurance that makes hands-on experimentation practical.

JWT Generator Formula & Method

token = base64url(header) + "." + base64url(payload) + "." + base64url(HMAC-SHA(signingInput, secret)) where signingInput = base64url(header) + "." + base64url(payload) and SHA size is 256/384/512 for HS256/HS384/HS512

Examples: JWT Generator

Input

alg HS256, payload {"sub":"1234567890","name":"John Doe","iat":1516239022}, secret "your-256-bit-secret"

Result

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

The header and payload are base64url-encoded and joined, then signed with HMAC-SHA256 using the secret to produce the canonical example token.

Input

Change the payload name to "Jane Doe" with the same secret

Result

The third (signature) segment changes completely while the header segment stays the same

The signature is an HMAC over the encoded content, so altering any claim changes the input and therefore the signature, which is how tampering is detected.

Frequently Asked Questions – JWT Generator

Enter your header and payload claims, choose an HMAC algorithm, and provide a signing secret. The generator base64url-encodes the header and payload, computes an HMAC signature over them using your secret, and joins the three parts with dots to produce the token. All of this happens in your browser through the Web Crypto API, so your secret is never uploaded.