Dev
Random API Key Generator
Used by developers, writers, and creators worldwide.
A random API key generator gives developers realistic, properly formatted keys without spinning up a real service. Use it when writing API docs, seeding test databases, or mocking authentication in a staging environment — keys that don't match expected formats break reader trust and introduce subtle bugs. This generator covers five key styles: 32- and 64-character hex strings, Base58-encoded keys, Stripe-style prefixed secrets like sk_live_..., and UUID-style identifiers. Generate up to a batch of keys at once, copy the full list in one click, and paste directly into fixture files, OpenAPI specs, or environment configs. For example, drop a hex-64 key into a Postman environment variable and your mock auth call works immediately. Keys are produced client-side and never transmitted, so they're safe for public repos.
Loading usage…
Free forever — no account required
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Set the count field to however many keys you need, such as 10 for a fixture file with multiple test users.
- Open the style dropdown and select the format that matches your target API — hex-32, hex-64, Base58, prefixed, or UUID.
- Click Generate to produce the full batch of randomly formatted API keys instantly.
- Review the output list and click Copy to transfer all keys to your clipboard in one action.
- Paste the keys directly into your test fixture file, markdown documentation, or environment config.
Use Cases
- •Seeding a multi-tenant staging database with unique per-row API credentials using a batch of 50+ keys
- •Writing OpenAPI/Swagger spec examples that show correctly formatted hex-64 or Base58 key values
- •Testing authentication middleware in Jest with fixture keys that match real format-validation regex
- •Mocking Stripe payment flows in a sandbox app using prefixed sk_live_... style secrets
- •Filling placeholder credentials in a public GitHub README without exposing any real secrets
Tips
- →When documenting a third-party API integration, match the generator's style to that API's real format so readers aren't confused by mismatched examples.
- →Generate at least 20 keys when seeding a test database — having extras avoids re-running the generator mid-setup if you miscounted rows.
- →Prefix hex keys manually with a service identifier like myapp_ before pasting into docs; it makes fixture keys self-documenting.
- →Use UUID-style keys only for documentation examples, never as a stand-in for a real security design — their fixed structure signals low entropy to any reviewer.
- →For parameterized tests, generate a batch equal to your test case count, then assign one key per case to ensure each test runs with a unique credential.
- →If your validation regex rejects generated keys, the mismatch itself is a useful finding — it may reveal a bug in your key-format assumption.
FAQ
are randomly generated API keys safe to use in public repos or open-source docs
Yes. Every key is generated entirely in your browser and never sent to any server or stored anywhere. They have no association with a real service, account, or credential, so publishing them in a public README, OpenAPI spec, or open-source test fixture carries zero security risk.
what's the difference between hex-32 and hex-64 api keys
Hex-32 produces a 32-character string representing 128 bits of entropy, visually similar to an MD5 hash. Hex-64 doubles that to 256 bits, which matches the security baseline most production APIs target. Choose hex-64 for docs that should reflect a properly secure key length, and hex-32 when matching a specific service that issues shorter keys.
which key style should I use to mock Stripe or similar payment API keys
Choose the prefixed style, which outputs keys in the sk_live_... pattern Stripe uses. That prefix combined with a Base58-encoded body avoids ambiguous characters like 0, O, and l. If your code runs a format-validation check on incoming keys, the prefixed style is the closest match without requiring a real Stripe account.