API Mock Data Generator
Generate realistic fake API responses for development and testing. Use template placeholders, build collections, or generate from JSON Schema.
How to Use the API Mock Data Generator
- Choose a mode — REST Endpoint for a single response, Collection for arrays of objects, Schema-Based to derive data from a JSON Schema.
- Enter your template — use
{{placeholder}}tokens in your JSON where you want fake values. - Click Generate — the tool replaces every placeholder with a realistic fake value.
- Copy or download — use the output for Postman mock servers, Cypress fixtures, Storybook stories, or unit tests.
Available Placeholder Tokens
The template engine supports a rich set of tokens for generating common data types:
{{uuid}}— RFC 4122-compliant UUID v4{{name}},{{firstName}},{{lastName}}— realistic full or partial names{{email}}— plausible email address{{phone}}— US-style phone number{{company}}— company name{{url}}— a full HTTPS URL{{date}}— ISO 8601 date string within the past two years{{timestamp}}— Unix epoch timestamp (milliseconds){{number(min,max)}}— random integer between min and max{{lorem(n)}}— n words of Lorem Ipsum filler text{{boolean}}—trueorfalse{{city}},{{country}}— geographic names{{color}}— CSS color name,{{hex}}— hex color code{{word}}— a random common English word
Why Use Mock Data During Development?
Working against live APIs during frontend development introduces several problems: network latency slows down your feedback loop, rate limits block rapid iteration, and production data cannot safely appear in screenshots, demos, or test suites due to privacy regulations like GDPR and CCPA. Mock data solves all three problems. You can iterate instantly, run unlimited requests, and share screenshots without redacting anything. Tools like Postman, WireMock, MSW (Mock Service Worker), and Mirage JS all accept JSON mock responses — paste the output of this generator directly into those tools.
JSON Schema Generation
JSON Schema is the de facto standard for describing the shape of API request and response bodies. Many API frameworks (OpenAPI, AsyncAPI, Zod, Yup, Ajv) use JSON Schema internally. When you paste a schema into the Schema-Based mode, this tool reads the type, properties, required, minimum, maximum, minLength, maxLength, and enum fields to generate a valid, well-typed mock object. This is particularly useful for contract testing — verifying that your frontend can handle every shape the API is permitted to return.
Building Large Collections
The Collection mode lets you generate up to 1,000 objects from a single template in one click. Large collections are essential for testing pagination components, virtual scroll lists, data tables, and search filters. Each object in the collection gets independently randomised values, so no two rows look identical. Use the JSON Lines format when your toolchain expects NDJSON (for example, Elasticsearch bulk import, BigQuery streaming, or Kafka consumers that process one event per line). Use the Wrapped format when your API contract wraps arrays in a response envelope like { "data": [], "total": 50, "page": 1 }.
Integration with API Testing Workflows
Paste generated mock JSON directly into Postman as a mock server response, Cypress as a cy.intercept() fixture, Playwright as a page.route() response, or Jest/Vitest as a module mock. For team workflows, save mock files alongside your source code in a __mocks__ or fixtures/ folder and commit them to version control so every developer and CI runner has the same stable test data. Use our JSON Formatter to validate and prettify the output before committing. To view your full API spec in a readable format, try the OpenAPI Viewer.