JWT Generator

Create signed JSON Web Tokens with HS256, HS384 or HS512, add issued-at and expiry claims, and check whether a token signature matches a secret.

Developer Tools Runs in your browser · no upload

Reviewed 23 November 2026 · Free · No account needed

ExecutionYour browserInput never leaves your tab
File retentionNoneNothing is stored
AccountNot requiredNo sign-up, no paywall
PriceFreeNo trial, no usage cap on the tool itself

How to use

  1. Edit the header and payload JSON, or keep the example.
  2. Choose HS256, HS384 or HS512 and type your secret.
  3. Press Set iat to now or pick an expiry to add time claims to the payload.
  4. Copy the signed token. To check a token, switch to Check a signature, paste it and enter the secret.

Example

Input: Payload with sub 1234567890, name John Doe and iat 1516239022, signed with HS256 and the secret your-256-bit-secret

Output: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

How it works

A JWT is three base64url parts joined by dots: the header, the payload and the signature. The header and payload are written as compact JSON and base64url encoded. The signature is an HMAC of those two parts, made with your secret and the SHA-2 hash that matches the algorithm.

signature = base64url( HMAC-SHA-x( secret, base64url(header) + "." + base64url(payload) ) ), where x is 256, 384 or 512 for HS256, HS384 or HS512.

Limits and edge cases

  • Only HMAC algorithms (HS256, HS384, HS512) are supported. RS256, ES256 and other key-pair algorithms are not.
  • The secret is used as plain UTF-8 text. It is not decoded from base64, so a server that base64-decodes its secret needs the decoded value here.
  • The header and payload are rewritten as compact JSON, with keys in the order you typed them, before they are signed.
  • Checking a signature does not check claims such as expiry or audience. A valid signature only shows the token was not changed.
  • base64url uses - and _ instead of + and /, and has no = padding, so tokens can sit safely in URLs.
  • Changing a single character of the header or payload makes the signature fail to match.
  • A token with alg none has no signature. The checker refuses to treat it as valid.
  • A secret shorter than the hash size (32 bytes for HS256) still signs, but a warning is shown because it is easy to guess.

Privacy

Signing and checking use the Web Crypto API in this browser tab. The header, payload and secret are never sent to a server or stored. Use test secrets here and keep production secrets on your servers.

About this page

Written and reviewed by Toolnexo on 23 November 2026. The limits above describe the published tool, not an idealised version of it. If a result looks wrong or the page is unclear, email [email protected] with the tool URL and what you entered. Corrections are published here.

Further reading

Guides that use JWT Generator

All guides →

Related tools

FAQ

Questions about JWT Generator

What is a JWT?

A JSON Web Token is a compact, signed way to pass claims between systems, such as who a user is and when a login expires. It has three base64url sections: a header, a payload of claims and a signature.

Which algorithms does the generator support?

HS256, HS384 and HS512, which sign with a shared secret using HMAC and SHA-2. Algorithms that use a private and public key pair, such as RS256 and ES256, are not supported here.

Is it safe to type my secret here?

The secret stays in your browser, because signing uses the Web Crypto API in this tab and nothing is uploaded. Still, use test secrets in web pages and keep production secrets in a server or secret manager, since anything typed on a device can be seen by software running on it.

Why does my server reject the token?

Common causes are a different secret, a secret that the server base64-decodes first, a different algorithm, an expired exp claim, or a payload that was changed after signing. Use Check a signature with the same secret to rule out the signature.

How do I make a token expire?

Press one of the Expires in buttons. It adds an exp claim, which is the expiry time in seconds since 1 January 1970, and sets iat to now. A server should reject the token after that time.