Free Tools · by The Cited Brand
100% FREE · NO SIGN-UP · NOTHING LEAVES YOUR BROWSER

API Key Generator

An API key generator for developers: make random API keys, app secrets, and JWT signing secrets in one click. Everything is made with your browser's secure random generator — never Math.random — and nothing leaves your device.

API Key Generator

Pick a type, press generate, and copy the key. A key is only as safe as where you store it — never commit keys to public code; use environment variables or a secrets manager.

A hex key uses only the characters 0–9 and a–f. 32 characters (128 bits) is enough for most uses; 64 characters (256 bits) is the safer choice for anything important.

What is an API key generator?

An API key generator makes a random string you can use as an API key — a secret your app shows to a service to prove who it is. The key must be unpredictable: if an attacker can guess it, they can use the service as if they were your app.

This one makes keys with your browser's built-in secure random generator — the same source your operating system uses for security keys — and never Math.random, which is predictable and must never be used for secrets. The key is made on your device and never travels anywhere.

How to generate an API key (3 steps)

  1. Pick a type above. API key (hex) for a simple access key, Random secret for a signing or encryption secret, JWT signing secret for signing JSON Web Tokens with HS256.
  2. Pick a size. 32 hex characters (128 bits) is enough for most uses; 64 characters (256 bits) is the safer choice for anything important. Longer costs nothing — your app reads the key from an environment variable, not from memory.
  3. Press "Generate" and copy the key. Save it in an environment variable or a secrets manager right away — this page never stores it, so a closed page means a lost key.

How to use the result (3 steps)

  1. Store it in an environment variable or a secrets manager. That is the right place for keys. Never write a key into your code, and never commit one to a Git repository — especially a public one.
  2. Give each app its own key. If one key leaks, you revoke only that one and the other apps keep working. Separate keys also show you which app made which request.
  3. Rotate keys on a schedule. Every 90 days is a common habit — and right away if someone with access leaves or you suspect a leak. Make the new key, update your app, then revoke the old one.

API key vs secret vs JWT secret

An API key is the string your app sends with each request to prove it is allowed in — like a password for machines. A secret is used to sign things: requests, webhooks, or tokens. It must never be sent or shared, because anyone with it can forge a signature. A JWT signing secret is one kind of secret: the key your server uses to sign JSON Web Tokens with HS256. If it leaks, anyone can forge a login token for any user — so guard it like a master password.

All three are made here from the same secure randomness. The difference is only the format: hex for keys (simple, easy to read), base64url for secrets (shorter for the same strength, safe in URLs and config files).

What this tool does NOT do

Here is the honest answer: this tool makes a key — it does not keep it safe for you.

A key is only as safe as where you store it. A 256-bit key pasted into a public GitHub repo is worthless the moment it is pushed. Store keys in environment variables or a secrets manager, and treat any key that appears in public as leaked: revoke it, make a new one, and check your logs.

It also cannot check whether a key is already in use somewhere, or revoke a leaked key for you. Revoking happens in the service the key belongs to — this page only makes the replacement.

More free tools

More free tools from The Cited Brand:

Frequently asked questions

What is an API key generator?

It is a tool that makes a random string you can use as an API key — a secret your app shows to a service to prove who it is. This generator makes keys in your browser with secure randomness, so each key is unpredictable and never leaves your device.

Is it safe to generate API keys in a browser?

Yes, when the randomness is real. This generator uses your browser's built-in secure random generator — the same source your operating system uses for security keys — and never Math.random, which is predictable. Nothing is sent to a server or stored anywhere.

How long should an API key be?

At least 128 bits of randomness — 32 hex characters — for most uses, and 256 bits (64 hex characters) for anything important. Longer keys are not harder to use, because your app reads them from an environment variable, not from memory.

What is the difference between an API key and a secret?

An API key is the string your app sends with each request to prove it is allowed in. A secret is used to sign things — requests or tokens — and must never be sent or shared. This page makes both: hex keys for IDs and access, and base64url secrets for signing.

What is a JWT signing secret?

A JSON Web Token (JWT) is a small signed message a server gives a logged-in user. The signing secret is the key the server uses to sign it with the HS256 method. Anyone with the secret can forge tokens, so keep it private and use a different secret for each app.

Where should I store an API key?

In an environment variable or a secrets manager — never in your code, and never in a public Git repository. If a key ends up in a public repo, treat it as leaked: revoke it, make a new one, and update your app.

Can I use the same key for two apps?

No. Give each app its own key. That way, if one key leaks, you revoke only that one — the other apps keep working. Separate keys also make it easy to see which app made which request.

How often should I rotate API keys?

Rotate them when someone with access leaves, when you suspect a leak, and on a regular schedule — every 90 days is a common habit. Make the new key, update your app, then revoke the old one. A key you never rotate is a key that quietly outlives its welcome.

What if my API key leaks?

Revoke it right away, make a new one, and update every place that used the old key. Then check your logs for requests made with the leaked key. Do not just delete the key from your code — once a key is public, anyone may have copied it.

Does this generator store my keys?

No. Every key is made in your browser and shown only to you. Nothing is sent to our server, nothing is stored, and nothing is logged. If you close the page without saving a key, it is gone — so copy it into your secrets manager right away.