← All tools/Generators/Security/JWT Generator

JWT Generator

Build and sign a JSON Web Token in your browser. Your secret never leaves this page — nothing is uploaded.

Your signed token

Signed JWT

HS256 · 3 parts

HeaderPayloadSignature
AlgorithmHS256
Signature—
Decoded header and payload
—

Everything runs locally in your browser using WebCrypto — your secret and token are never sent anywhere. Only use test secrets here; never paste a production secret into any web page.

How it works

token = base64url(header) + "." + base64url(payload) + "." + base64url(HMAC-SHA256(secret, header + "." + payload))

Header {“alg”: “HS256”, “typ”: “JWT”} and payload {“sub”: “1234567890”, “name”: “John Doe”, “iat”: 1516239022} with secret “your-256-bit-secret” sign to eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c — the canonical jwt.io example, verified by recomputation.

Signing is byte-exact: any change to the header, payload or secret changes the signature. Verified in Node against the canonical jwt.io test vector (HS256, secret “your-256-bit-secret”). Last updated November 2026.

Frequently asked questions

What is a JWT?

A JSON Web Token is three base64url parts joined by dots: a header, a payload of claims, and a signature. Servers verify the signature with the secret, so they can trust the claims without storing a session.

Is my secret safe here?

Yes — signing happens in your browser with WebCrypto and nothing is uploaded. Even so, only use test secrets in any online tool, and never share a production secret.

What is the difference between HS256, HS384 and HS512?

They use SHA-256, SHA-384 and SHA-512 inside the HMAC. HS256 is the common default; HS384 and HS512 produce longer signatures. The server must expect the same algorithm.

Why does my token not verify on the server?

Usually the secret or the algorithm differs, or the payload JSON has different spacing or key order — signing is byte-exact, so any change changes the signature. Copy the token exactly, with no extra spaces.

What does the exp claim do?

exp is the expiry time as seconds since 1 January 1970. Servers reject tokens after exp. Use the expiry preset above to add one, or leave it out for a token that never expires.

More tools

Tell us what you think

Loving this tool, or stuck on something? Tell us — it takes a minute.

We’ll only use your name and email to reply if needed. The tool and page are filled in for you.