API Key Generator
Generate random API-key-shaped strings for placeholder/test use.
Generates random API-key-shaped strings (sk_ prefix + 32 alphanumeric characters) using crypto.getRandomValues() — for placeholder/test use, not a real credential. Runs entirely in your browser.
Need the opposite? Bcrypt Generator
What is API Key Generator?
Generates random strings shaped like a typical API key (a short prefix plus 32 random alphanumeric characters), using crypto.getRandomValues(), the same cryptographically secure random source browsers use for things like session tokens. It's meant for placeholder UI mockups or test fixtures, not a real credential your service should actually issue. It's useful anywhere you need a realistic-looking key without wiring up a real auth backend yet: seeding a demo dashboard, populating a `.env.example` file, or writing a test fixture that expects an API-key-shaped string. Everything runs in your browser, so nothing you generate here is sent anywhere or logged.
How to Use the API Key Generator
- 1
Generate a Key: Click Generate to produce a new random, API-key-shaped string.
- 2
Copy the Key: Use the copy button to copy it into your placeholder UI, .env.example file, or test fixture.
- 3
Generate Again as Needed: Click Generate again any time for a fresh value.
How It Works
Each key is assembled from a short prefix plus 32 random alphanumeric characters, drawn using the browser's crypto.getRandomValues() rather than Math.random(). That's the same random source used for things like session tokens, so the character sequence isn't predictable from a previous result. That covers randomness, not the rest of what a real API key needs: server-side issuance, hashed storage, scoping to a specific user or permission set, and revocation. This tool only produces a key-shaped string. Treat every result as suitable for test or placeholder use, not as a credential your service actually issues.
Common Use Cases
Populating a .env.example file so new contributors see the expected shape of a key without a real one being checked into the repo.
Seeding a demo dashboard or admin panel before real auth is wired up.
Writing a test fixture or mock API response that expects an API-key-shaped string, without needing a live backend to generate one.
Example Output
A generated key looks something like this (yours will differ every time):
sk_test_a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6Frequently Asked Questions
Common questions about API Key Generator.