API Key Generator

Generate random API keys

    What Is This Tool?

    The API Key Generator creates cryptographically random API keys or tokens using your browser's crypto.getRandomValues secure random number generator, with an optional prefix, a choice of character sets, and support for generating a whole batch at once. It's a fast way to get placeholder or real client-side-generated keys for development. Nothing you generate is ever stored or transmitted.

    How to Use

    1

    Set the key length, an optional prefix, character set, and quantity.

    2

    Click Generate.

    3

    Copy an individual key, copy all of them, or download the batch as a text file.

    Features

    • Uses crypto.getRandomValues with rejection sampling for unbiased randomness
    • Optional custom prefix (e.g. sk_live_, api_)
    • Alphanumeric or alphanumeric + symbols character sets
    • Generate 1 to 20 keys at once
    • Per-key copy button, plus Copy All and Download as .txt
    • 100% client-side — keys are never sent to or stored on a server

    Examples

    Settings: length 24, prefix sk_live_, alphanumeric only

    Example output:

    sk_live_4G8pQwXz2LmN7RtY0KdV1sBh

    Common Use Cases

    • Generating a placeholder API key for local development or documentation
    • Creating a batch of unique client identifiers or tokens for testing
    • Producing a random secret to use as an API key in your own backend
    • Quickly seeding sample data with realistic-looking key strings

    Frequently Asked Questions

    Are these keys cryptographically secure?

    Yes. Keys are generated using the browser's Web Crypto API (crypto.getRandomValues), the same secure random source used for cryptographic operations, with rejection sampling applied so every character choice is unbiased.

    Are generated keys stored or sent anywhere?

    No. Keys are generated and displayed entirely in your browser and are never transmitted to a server or persisted anywhere once you leave or refresh the page.

    Can I use these as real production API keys?

    The randomness itself is cryptographically strong, but a generated string only becomes a working API key once your backend issues and recognizes it. Use this tool to produce the random value, then register it in your own system.

    What's the difference between the two character sets?

    Alphanumeric uses only A-Z, a-z, and 0-9, which is broadly URL- and shell-safe. Alphanumeric + symbols adds common punctuation characters for higher entropy per character, but may need escaping in some contexts (URLs, shells, CSV).

    Does the prefix count toward the key length?

    No. The length setting controls only the random portion of the key; any prefix you enter is added in front of it, so the final key is longer than the length value by the prefix's character count.

    Can I generate more than 20 keys at once?

    This tool caps a single batch at 20 keys to keep the page responsive. Run Generate again for additional batches.