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)
- 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.
- 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.
- 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)
- 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.
- 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.
- 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:
- llms.txt Generator & Validator — make a clean llms.txt file for your site in 2 minutes, and check any file against the basic rules.
- AI Crawler Checker — see whether GPTBot, ClaudeBot, PerplexityBot and 20 more AI crawlers can reach your site, or your robots.txt blocks them.
- Schema Markup Generator — make valid JSON-LD code for your pages, so search engines understand what each page is about.
- robots.txt Checker — check any site's robots.txt file: rules by bot, problems in plain words, a per-bot verdict table, and a tester for single pages.
- robots.txt Generator — build a robots.txt file in minutes: pick which AI bots may visit, add your sitemap, and download the file.
- AI Crawler Diagnostic Tool — diagnose your site for AI crawlers: find what blocks them and get the exact fix for each problem.
- AI Crawler Monitoring — keep watch after the check: spot AI bot visits in your server logs, Cloudflare analytics, and GA4.
- AI Agent Directory — the full list of 23 AI crawlers: who runs each one, what it does, and how to check a real visit.
- Secure Password Generator — generate a secure password or a word-based passphrase in one click. Made in your browser, never stored or sent anywhere.
- QR Code Generator — make a free QR code that never expires, for a link, text, Wi-Fi, email or phone. No account, no tracking, nothing uploaded.
- Password Strength Checker — check a password you already have: entropy, crack time, and pattern warnings, all in your browser.
- QR Code Reader — scan a QR code from an image or your camera and see what it holds, with a warning for risky links. Nothing uploaded.
- UUID Generator — make random UUIDs in one click — v4, v1, or the modern time-ordered v7. Made in your browser, never stored or sent anywhere.
- Lorem Ipsum Generator — generate lorem ipsum in one click — paragraphs, sentences, words, characters or lists, as plain text, HTML, Markdown or JSON. Made in your browser, never stored or sent anywhere.
- Timestamp Converter — convert a Linux timestamp to a date and back — seconds, milliseconds, microseconds or nanoseconds, in any timezone, with copyable date commands. Made in your browser, never stored or sent anywhere.
- DNS Leak Check — check for DNS leaks: WebRTC test, visible IP + ISP + ASN, IPv6 exposure, encrypted-DNS reachability, and a DNS resolver identifier. Honest about its limits, no VPN ad.
- Tip Calculator — calculate a tip, the total and each person's share — bill, tip %, split, round-up, service presets and a comparison table. Free, no sign-up, nothing stored.
- API Key Generator — make random API keys, secrets, and JWT signing secrets for your apps. Made in your browser, never stored or sent anywhere.
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.