JWT Signer & Signature Verifier

Cryptographically sign and verify HS256 JSON Web Tokens locally in your browser.

Generated JWT Token
Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/jwt-signer" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/jwt-signer" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - JWT Signer & Signature Verifier</a></div>

The Risk of Pasting JWT Secrets Online

JWT (RFC 7519) authentication relies on HMAC secret keys or private keys. Entering production secrets into third-party web debuggers exposes your backend to credential theft and unauthorized token forging. Lucentool computes HMAC signatures entirely offline.

HS256 HMAC-SHA256 Architecture

What happens in the page

Signing goes through the browser's Web Crypto API rather than a bundled library. base64UrlEncode() produces standard Base64 and then rewrites it into the URL-safe alphabet — plus becomes minus, slash becomes underscore, padding is stripped — because a JWT has to survive being placed in a header or a query string. signToken() concatenates the encoded header and payload, imports your secret as an HMAC key with crypto.subtle.importKey and signs the result, and verifyToken() repeats the computation over the token you paste and compares the two signatures. base64UrlEncodeBuffer() exists because the signature is bytes, not text.

Where it breaks down

Only the HMAC family is implemented — HS256, HS384 and HS512. Asymmetric signing needs a private key import and a different algorithm parameter, which this page does not do, so an RS256 or ES256 token cannot be produced here. The secret lives in the form field and in memory, never in storage, so a reload loses it. Web Crypto is only exposed in a secure context, which means opening the file directly from disk fails with a clear message rather than silently misbehaving.

Privacy: no data leaves this tab

The secret is typed into a form field and used for one HMAC operation in memory. Nothing is written to storage, no request is made, and clearing the field removes the only copy the page ever had.

Frequently asked questions

Can it produce an RS256 token?

No. Asymmetric algorithms need a private key and a different Web Crypto call; this page deliberately stays with HMAC so the secret never has to be pasted as a key file.

Why does it refuse to run locally?

Web Crypto requires HTTPS or localhost. Opened as a file:// URL, crypto.subtle is undefined, and the page tells you instead of failing quietly.

Should I paste a production secret?

No. Use a throwaway value for testing. Nothing is stored, but anything you paste also lands in your clipboard history and screenshots.