Yes, an online JWT secret generator can be safe, but only when "online" describes how the page reaches you, not where the key is created. A correctly built generator creates the secret inside your browser with the browser's built-in crypto.getRandomValues function, keeps it in memory, and copies it to your clipboard through your own device; no request needs to carry the key to a server. The risk starts when a page generates the key on its backend, uses Math.random instead of a cryptographic random source, or quietly posts the result to an endpoint. You do not have to take a privacy statement on faith: open DevTools, watch the Network panel while you generate a key, and read the code that produces it. The checks below take about a minute and work on this generator or any other one you find.

What makes an online JWT secret generator safe?

Three things decide the answer, and a page can get one right while failing another. Check all three before you trust a key.

Browser
The key is created in your browser with the Web Crypto API and never sent to a server.
Random
crypto.getRandomValues or crypto.subtle.generateKey, never Math.random, a timestamp or a counter.
Server
Nothing from the tool reaches the server: no logs, no database rows, no analytics events that contain the key.

Any one of these checks failing is enough to walk away. A key returned by a request, a random source you can guess, or a payload that contains the secret all mean the page cannot be trusted with a real signing key.

The key is generated in your browser

"Online" only means you open a web page instead of a terminal tool. The page itself can be served from anywhere; what matters is where the random bytes are produced. In a safe generator the Generate button calls JavaScript running on your device. The key exists in the page's memory, and Copy key writes it to your clipboard with the Clipboard API. The server that delivered the files has no part in the calculation and never needs the result.

If the button instead sends a request and the key arrives in the response, the server generated it. That server can keep a copy, log it, or leak it, and no sentence on the page can prove otherwise. The DevTools test below tells the two patterns apart in about a minute.

The random source is a CSPRNG

A JWT secret has to be unpredictable, not merely unique. Browsers expose a cryptographically secure pseudorandom number generator (CSPRNG) through crypto.getRandomValues, which fills a typed array with bytes taken from the operating system's entropy pool. That is the same kind of source a password manager uses. MDN documents the method in Crypto: getRandomValues().

What you do not want to see is Math.random(), a timestamp, or a counter used as the seed. Those values are made for animations and shuffling, not for secrets; an attacker may recover their internal state and predict later keys. The weakness has its own entry in the Common Weakness Enumeration: CWE-338, Use of Cryptographically Weak Pseudo-Random Number Generator.

No request carries the key to the server

Client-side generation only covers the moment the bytes are created. A page could still send the finished key to an endpoint under the name "telemetry" or hide it in a query string. A safe generator never puts key material in a URL, a form post, an analytics event, or a beacon. It also does not save it to localStorage or a cookie where a later script could read it; the value stays in memory until you close the tab.

Analytics is not automatically a problem, as long as the key is not part of the payload. This site's page-view script records the page, the referring page, and coarse device, browser and country information, never anything the tool generates. The Network test below shows exactly which requests leave the page.

How do I check a generator in DevTools?

The test has three steps: open the Network panel, generate a key while it records, and judge what left the page. Run it once on any generator you plan to use for something real.

Step 1: Open DevTools and the Network panel

Open the generator in Chrome, Edge, Firefox or Safari, then press F12 on Windows or Linux, or Command+Option+I on a Mac. Right-clicking the Generate button and choosing Inspect also works. In Safari, first enable the Develop menu under Safari Settings, Advanced, then open Develop and Show Web Inspector.

Switch to the Network tab. Tick Preserve log so a reload does not erase the list, then click the clear button (the circle with a slash) so recording starts from an empty panel.

Step 2: Generate a key and watch the request list

Tap Show so the key is visible, copy its first 12 characters, and keep them next to the browser. Then click Generate secret (the button reads Regenerate after the first click) and watch the list.

Generate a key two or three times. In a safe generator the list stays empty or shows nothing but a page view or a saved file. If a new request appears, click it and open the Payload or Request tab, then use Ctrl+F or Command+F inside that panel to search for those 12 characters. A match anywhere in the URL, headers, or payload means the key left the device, and a key that was uploaded should not be used.

Click Copy key as well: clipboard writes happen locally and should not create a request. A cloud clipboard or a "share" service would show up here right after the click.

Step 3: Prove the browser created the key

Two quick proofs remain. First, open the DevTools search panel with Ctrl+Shift+F on Windows or Linux, or Command+Option+F on a Mac, and search for getRandomValues. You should land in the generator script. If the only random source you can find is Math.random, close the page.

Second, open the Network panel's throttling dropdown, choose Offline, and click Regenerate. If a fresh key still appears while the browser has no connection, the bytes were produced on your device. Switch throttling back to No throttling when you are done.

No new request, and the key changes
Generated in your browser, which is a good sign.
A new request appears after the click
Open it and search the URL and payload for your key fragment; a match means the key was sent.
Requests appear only on page load
Usually page views and static files; check their payloads once, then clear the list.
A new key still appears in Offline mode
Strong proof that the randomness is local.

If you reloaded with DevTools open, you will see the document, styles, scripts and page-view requests. Those belong to the page load, not to the key generation. Clear the list after loading and before you press Generate secret.

Is HTTPS enough to protect the key?

No. HTTPS encrypts the connection between your browser and the server, and it is still necessary: without it, someone on the same Wi-Fi could tamper with the JavaScript before it runs. But HTTPS says nothing about what the server does after a request arrives. If the server generates the key, or receives it, TLS does not stop that server, its logs, or its operators from keeping a copy. Encryption protects data in transit, not data in someone else's memory.

The random source matters for the same reason. A generator can load over a valid certificate, look polished, and still use a predictable seed. Judge the code and the network traffic, not the padlock. The MDN Web Crypto API overview lists the primitives a sound generator should use.

When is an online generator fine, and when is it not?

A browser-generated key is perfectly good for most development work. It is not the right tool for a production signing secret that protects accounts, money, or admin access.

Fine to generate in a browser:

Better generated on a server or in a KMS:

For production, generate the bytes where they will live. On a build machine or server, OpenSSL ships with Linux and macOS:

# 64 random bytes, Base64 (enough for HS512)
openssl rand -base64 64

# 32 random bytes in unpadded Base64URL (enough for HS256)
openssl rand -base64 32 | tr '+/' '-_' | tr -d '='

Node.js can do the same without extra tools:

node -e "console.log(require('crypto').randomBytes(64).toString('base64url'))"

Store the output in a secret manager and inject it as an environment variable at runtime. A cloud KMS goes further: AWS KMS, Google Cloud KMS and Azure Key Vault can generate key material inside a hardware security module and sign requests without ever exporting the raw key. That is the usual choice when the token protects something valuable. For opaque tokens that are not JWTs, a random string generator is often a better fit than a signing key.

Minimum HMAC key length by JWT algorithm (RFC 7518 section 3.2)
AlgorithmBytesHex charactersBase64URL characters
HS256326443
HS384489664
HS5126412886

Longer keys are allowed; these are the minimums the spec requires. The generator on the home page accepts up to 256 bytes, and changing the encoding (Hex, Base64, Base64URL) does not change the underlying bytes.

What else can leak a key besides the website?

The website is only one place where a secret can escape. On a desktop browser, extensions with permission to read and change page data can see the generated key and your clicks; a clipboard manager or a screen recorder can capture it too. Public or shared computers add another risk: browser history, clipboard history and sync features may keep a copy after you leave.

Frequently asked questions

Does an online generator record or upload my JWT secret?

A generator that runs entirely in your browser cannot upload what it never sends. On this site the key is created with crypto.getRandomValues, stays in the page memory, and only leaves through the Copy key button. The page-view analytics records the page, the referring page, and coarse device, browser and country information, never anything typed into the tool. Run the DevTools test above on any other generator before you trust it: generate a key, then search every request for 12 characters of that key.

Is HTTPS enough to make an online JWT generator safe?

No. HTTPS protects the connection between your browser and the server, and it is still required, because without it a network attacker could change the JavaScript before it runs. But encryption in transit says nothing about the server that generated or received the key. If the key is built server-side, TLS does not stop that server from logging it. Safe means client-side generation with a CSPRNG, not just a padlock in the address bar.

Can I use the generator offline?

Yes, once the page is loaded. The random bytes come from your device, so pressing Regenerate with the browser offline or the phone in airplane mode still produces a fresh key. Loading the page for the first time needs a connection, and a page that is not cached may need one again after a reload. That offline behavior is also the simplest proof that generation is local: a server cannot return a new key while the network is down.

Should I worry about browser extensions?

Yes, a little. An extension with permission to read and change data on the page can see the generated key and every click around it, and no website can block that. Generate secrets in a browser profile with no unfamiliar extensions, or in a private window where extensions are turned off. Screen-sharing tools, remote-support sessions and clipboard managers can observe the value the same way, so close them before you work with a key that matters.

How often should I rotate a JWT secret?

Rotate on a fixed schedule and immediately after any suspected leak. Many teams use 30 to 90 days for long-lived services and rotate sooner for keys that protect high-value actions. Add a kid header to each token, keep the matching keys in the verifier, and retire the old key only after the longest token lifetime has passed, so tokens signed before the switch still verify while new ones use the new secret. Delete the retired key from every environment and from the secret manager.

Generate a JWT secret key

To put the checks into practice, open the client-side JWT secret generator and decode the token you get in the token decoder.