All tools · Utilities

API Key Generator

Batches of random secret keys — pick bit strength, character set, and prefix.

Free to use, no sign-up required. API Key Generator is one of 198 tools built into Xenition, alongside a chat that can use them for you.

Generates random secret keys and tokens for APIs, webhooks, session secrets and test fixtures, one at a time or in batches of up to 500.

How to use API Key Generator

  1. Set Number of keys (1–500) and Key length (bits): 64, 128, 256 or 512.
  2. Choose the Type of characters: Mixed, Hex, Letters only or Numbers only.
  3. Add a Prefix (optional) such as sk, and pick a Separator if you are making several keys.
  4. Press Generate key or Generate API keys, then Copy all.

How it works

All randomness comes from crypto.getRandomValues, with rejection sampling so every character is equally likely. The key length is the number of characters needed to carry the chosen bits: bits divided by log2 of the set size, rounded up. Hex writes bits ÷ 8 random bytes as two hex digits each. A prefix gets an underscore added unless it already ends in _ or -. The Strength label reads Weak at 64 bits, Strong at 128, Very strong at 256 and Extreme at 512.

Example

At 256 bits, Mixed gives 43 characters, Letters only 45, Numbers only 78 and Hex 64. With prefix sk the key looks like sk_ followed by 43 letters and digits.

Questions about API Key Generator

How many bits should an API key have?

At least 128 bits, which cannot be guessed by brute force. 256 bits is a common default for long-lived secrets. The tool labels 64 bits as Weak for that reason.

Does the prefix make the key stronger?

No. The prefix is fixed text, so it adds no entropy. It helps people and secret scanners recognise the key.

Use it from chat

You do not have to open API Key Generator to use it. Ask Xenition in plain language and it runs the right tool, then carries the answer into whatever you are working on — a document, a spreadsheet, a deck.

Related tools