Free JWT Generator Online

Create HS256 JSON Web Tokens easily with our free, browser-based JWT generator. No upload or signup required. Just enter your secret key and payload.

Free online file converter tool. Works in Chrome Firefox Safari Edge Opera and other modern browsers on Windows macOS Linux Android and iOS. No software installation required. Browser-side processing keeps your file local when supported. Completely free to use with no account needed.

Free JWT Generator Online

Generate signed HS256 JWT tokens with custom payload and expiry. Runs entirely in your browser.

HS256

Key Features

Everything you need to create JWT tokens

HS256
HS256 Signing

Generates tokens signed with HMAC-SHA256. Compatible with all major JWT libraries and frameworks.

JSON
Custom Payload

Add any claims to the JSON payload. Standard claims like sub, name and iat are pre-filled.

SEC
Privacy-Aware

HMAC computation can run client-side in browser-side mode. Avoid entering sensitive keys unless local processing is clearly shown.

How to Generate a Signed JWT

  1. Enter Your Secret Key

    Type the HMAC secret into the Secret Key field. This same string must be used by your application to verify the token, so keep it consistent. Longer, random secrets of 32 characters or more produce stronger signatures. The secret stays on your device because the signing runs in your browser.

  2. Edit the Payload and Pick an Expiry

    Adjust the JSON payload to hold your claims, such as sub, name, or any custom fields. The tool keeps your iat if present and otherwise stamps it automatically. Choose an expiry of 1 hour, 24 hours, 7 days, 30 days, or a custom value in seconds, which is added to the current time to set the exp claim.

  3. Generate and Copy the Token

    Click Generate JWT to build the three-part token. The header is fixed to HS256 and typ JWT, the payload is Base64URL encoded, and the signature is computed with HMAC-SHA256. Use the Copy button to grab the full token, then paste it into your client, API request, or a debugger to inspect it.

What Goes Into the Token

Every JWT this tool produces has three Base64URL segments joined by dots: a header, a payload, and a signature. The table below shows which parts are fixed and which you control.

ElementSet ByValue or Behavior
Header algFixed by toolHS256 (HMAC with SHA-256)
Header typFixed by toolJWT
Payload claimsYouAny valid JSON, for example sub, name, roles
iat claimTool if missingCurrent Unix time when you generate
exp claimToolCurrent time plus your chosen expiry
SignatureTool from your secretHMAC-SHA256 over header.payload

When This Generator Fits

Local Development

Spin up a valid HS256 token in seconds to test a protected endpoint without wiring up a full auth flow first. The signing happens on your device, so you can iterate quickly.

API Testing and Debugging

Craft a token with specific claims and expiry, then drop it into a request header to check how your service validates and decodes it. Useful for reproducing edge cases like an expired exp.

Learning JWT Structure

See exactly how the header, payload, and signature combine into a single string. Edit the payload and regenerate to watch how each change alters the encoded segments.

When to Use Something Else

If you need RS256, ES256, or other asymmetric algorithms, or production token issuance with key rotation, use a server-side JWT library. This tool covers HS256 symmetric signing only.

Common Problems and Fixes

Please enter a secret key

The Secret Key field is empty. A signature cannot be computed without it, so type any HMAC secret before generating. For meaningful security use a long, random value rather than a short word.

Invalid JSON payload

The payload box must contain valid JSON. Check for missing quotes around keys, trailing commas, or unescaped characters. The error message includes the parser detail so you can find the exact spot, then click Generate again.

Token fails signature verification

The verifier must use the identical secret and the HS256 algorithm. A mismatch in the secret, extra whitespace, or expecting RS256 will cause verification to fail. Confirm both sides share the same string.

Token reports as expired

The exp claim is set to the moment of generation plus your selected expiry. If a short window like 1 hour has passed, generate a fresh token or choose a longer expiry or a larger custom value in seconds.

References

  1. RFC 7519: JSON Web Token (JWT) - IETF
  2. RFC 7515: JSON Web Signature (JWS) - IETF
  3. RFC 7518: JSON Web Algorithms (HS256) - IETF
  4. SubtleCrypto (Web Crypto) - MDN Web Docs, Mozilla
  5. SubtleCrypto.sign() - MDN Web Docs, Mozilla
  6. Introduction to JWT - jwt.io
  7. RFC 4648: base64url encoding - IETF
  8. Clipboard.writeText() - MDN Web Docs, Mozilla