API Key Format Generator

API Key Format Generator

Local Processing

Generate realistic mock API key strings with custom service prefixes (e.g. sk_live_, pk_test_) for testing and mocking.

How It Works & Processing Standards

Generate realistic mock API key strings with custom service prefixes (e.g. sk_live_, pk_test_) for testing and mocking.

Tool processing runs in your browser. If you create a calculator or conversion share link, its values are included in the URL. See the privacy policy for account, analytics and advertising data.

Current Limits

  • Maximum input length: 2,000,000 characters

Set a prefix and random byte count to get a "prefix_randomstring" key. The random part is Web Crypto randomness in Base64URL, so it drops straight into URLs and headers.

These are random strings, not keys for any real external service.

What You Can Do

Prefix
Marks the key type, such as sk, pk or api (letters, digits, _ and -, up to 16).
Random body
8–64 bytes of secure randomness in Base64URL.

How to Use API Key Format Generator

  1. 1
    Set the prefixThe default is sk.
  2. 2
    Set the lengthChoose the random byte count (default 24).
  3. 3
    Generate and copyCopy the key.

Examples

Default (sk, 24 bytes)
Input: Prefix sk, bytes 24
Result: sk_ plus 32 characters (e.g. sk_b8yw7AN5cVvWd1tWzIO8-YxsXPaooV4U, different every time)

Common Use Cases

  • Designing the API key format your service issues to users
  • Fake keys for docs and test code

Frequently Asked Questions (FAQ)

Why add a prefix?

It shows at a glance what the key is for (secret or public), and makes accidentally committed keys easier for secret scanners to find.

Have feedback or ideas for this tool? Suggest & Inquire →