01What is API Key Generator?
Every new service needs a secret sooner or later, and Math.random() is not the place to get one. This generator reads bytes from crypto.getRandomValues, the browser's cryptographically secure source in the Web Crypto API, and turns them into keys in five formats. Nothing is sent to a server. The Length field always counts characters of random output, between 8 and 128. Hexadecimal gives 4 bits per character, so 32 hex digits carry 128 bits. Base62 draws from 0-9, A-Z and a-z. It throws away any byte of 248 or more before taking the value modulo 62, so every character is equally likely and there is no modulo bias. Each Base62 character is worth about 5.95 bits, which means 22 characters already pass 128 bits. Base64URL uses the URL-safe alphabet from RFC 4648, with - and _ in place of + and /, and no padding. That is 6 bits per character. UUID v4 takes 16 random bytes and sets the version and variant bits as RFC 9562 describes, leaving 122 random bits. Its size is fixed, so the Length field disappears when you pick it. Prefixed glues a label such as sk_live onto a Base62 body with an underscore, in the style payment APIs use to separate live and test keys. Here Length counts only the random part. You can ask for up to 20 keys at once. Each result shows the key, its format, its total length and a Randomness figure in bits. Copy buttons sit next to each key, and Copy all appears when there is more than one. A worked example: choose Prefixed, type sk_test as the prefix, set Length to 24 and click Generate. You get something shaped like sk_test_Dn4wV5kAfuNkI4Jpw00M4Bch. The tool reports a length of 32 because the prefix and underscore are counted, and 142 bits because only the 24 random characters carry entropy. A few things to keep in mind. The prefix is trimmed and extra trailing underscores are dropped, so sk_live_ still gives one underscore. A blank prefix gives a plain Base62 key with no underscore. Bits are rounded down for Base62. The tool only creates strings. It does not store, hash, rotate or revoke keys, so that work stays in your backend. And a key is only as safe as where you paste it, so keep it out of chat logs and commits.
Backend and platform developers who need to mint random secrets, test credentials or IDs for services they are building. The tool runs entirely in your browser, so your data never leaves your device.
02How to use API Key Generator
- Choose a Format: Hexadecimal, Base62, Base64URL, UUID v4 or Prefixed.
- Set the Length between 8 and 128. For Prefixed the label reads Random characters (after prefix), and for UUID v4 the field is hidden.
- For Prefixed, type a label such as sk_live in the Prefix box. The tool adds the underscore for you.
- Enter a Count of up to 20 and click Generate.
- Copy a key with the icon beside it, or use Copy all when you made several. Reset clears the list.
03Worked examples
- Input:
Hexadecimal, Length 32 - Result:
5cef4781cb8d6fe10186a49f21ff699c Length: 32 | Randomness: 128 bits - A sample run. The key changes every time, but the length and bit count are fixed by the format.
- Input:
Base62, Length 22 - Result:
5xSTPiPgysLBlh4TtZUUkQ Length: 22 | Randomness: 130 bits - Sample run. 22 x log2(62) is about 130.99, rounded down to 130.
- Input:
Base64URL, Length 43 - Result:
Qcb59YXX5rNOyuWYM1eQyl3O9CnovPPGb9PlChU8kPa Length: 43 | Randomness: 258 bits - Sample run. URL-safe alphabet with no padding, 6 bits per character.
- Input:
UUID v4 - Result:
cfeb3305-a2a8-4caf-8b62-a80637cd71fe Length: 36 | Randomness: 122 bits - Sample run. The 4 in the third group is the version and the 8 starting the fourth group is a variant digit (8, 9, a or b).
- Input:
Prefixed, Prefix sk_test, Length 24 - Result:
sk_test_Dn4wV5kAfuNkI4Jpw00M4Bch Format: prefixed (sk_test_) | Length: 32 | Randomness: 142 bits - Sample run. Length counts the prefix and underscore, while the bits count only the 24 random characters.
04Common use cases
- Filling API_SECRET in a .env file for a new Express or FastAPI service
- Issuing sk_test_ keys for staging so a leaked log line clearly points at a test credential
- Generating 20 partner keys in one batch to load into a database during onboarding
- Creating a UUID v4 to use as an idempotency key or webhook endpoint ID
- Picking a URL-safe Base64URL token to put in a magic-link or invite URL
- Checking how many characters a format needs to reach 128 bits before you set a column width
05Tips
- Store only a SHA-256 hash of the key on the server and show the plaintext once. High-entropy keys do not need a slow password hash.
- A trailing underscore on the prefix is fine. The tool keeps a single one, so sk_live_ and sk_live give the same shape.
- Judge a Prefixed key by the Randomness figure, not the total length, because the prefix adds no entropy.
- Base62 keys contain no - or _, so a double-click in most editors and terminals selects the whole key.
- A distinct prefix makes leaked keys easier to catch with secret scanners that match on custom patterns.
06Related concepts
Entropy, CSPRNG, Base62, UUID v4, Secret scanning.
Frequently Asked Questions
What is API Key Generator?
API Key Generator is a free, browser-based developer tool on AIDToolStack. Generate API keys in various formats It requires no installation or sign-up and works entirely in your browser.
Is API Key Generator free to use?
Yes. No sign-up, no fees and no usage cap.
Does API Key Generator store my data?
No. It runs in your browser; nothing is uploaded.