Mock Data Generator — Generate Fake JSON Data Online Free

Define fields and generate realistic mock JSON data for testing and development.

Fields
Output (10 records)

What is a Mock Data Generator?

A mock data generator is a developer tool that creates realistic but entirely fictional datasets following a schema you define. Instead of manually crafting test data or seeding databases with real user information, you define the shape of your data — field names and types — and the generator instantly produces a JSON array of records populated with plausible random values. This is essential for front-end prototyping, API testing, database seeding, and automated test suites where using real production data would violate privacy regulations or simply be impractical.

This tool runs entirely in your browser. No data is sent to any server, and all generation happens locally using JavaScript's cryptographic random number generator for maximum unpredictability. You can generate up to 100 records at once and download the result as a .json file for immediate use in your project.

Supported Field Types

  • string — Random alphanumeric string (8 characters), suitable for codes, tokens, or slugs.
  • number — Random integer between 1 and 10,000, suitable for IDs, quantities, prices, or scores.
  • boolean — Randomly true or false, suitable for flags and status fields.
  • date — ISO 8601 date string from the last 2 years, suitable for created_at, updated_at, or birthdate fields.
  • uuid — Standard UUID v4 (e.g. 550e8400-e29b-41d4-a716-446655440000), suitable for primary keys in distributed systems.
  • email — Realistic-looking email address combining a random name with a common domain, suitable for user records.
  • name — Full name combining a first name and last name from a curated list of common English names.
  • phone — North American phone number in +1-XXX-XXX-XXXX format.

Common Use Cases

  • Front-end prototyping — Feed realistic JSON into your UI components before the real API is ready. Populate tables, cards, and lists with believable data instead of "foo", "bar", "test123".
  • Database seeding — Paste the downloaded JSON into a seeding script to populate development and staging databases with enough records to test pagination, filtering, and search performance.
  • API testing — Use Postman, Insomnia, or curl to POST the generated records to your API and verify validation logic, constraint checks, and error handling under realistic conditions.
  • Unit and integration tests — Embed generated fixtures directly in your test files. Having consistent but realistic test data makes assertions clearer and tests more maintainable than magic strings.

Frequently Asked Questions

How do I use the generated JSON in my project?

Click "Download" to save a .json file, then import it in JavaScript/TypeScript with import data from './mock-data.json' (works in Vite, webpack, and Node.js). Alternatively, copy the JSON and paste it as a fixture in your test file or use it as a request body in your API testing tool.

Can I add nested objects or arrays?

This tool currently generates flat JSON objects. For nested structures, generate the parent and child records separately, then combine them using a script: match child records to parents via an id / foreign key field. This approach also mirrors how most relational databases and REST APIs structure their data.

Is the generated data safe to use in demos?

Yes. All data is entirely random and fictional — names, emails, and phone numbers are not tied to real individuals. The email addresses use common public domains but are randomly constructed and almost certainly do not belong to real mailboxes. Still, avoid publishing mock data in a way that could be mistaken for real user records.

How do I seed a PostgreSQL or MySQL database with this JSON?

In Node.js, read the file and loop with your ORM: await User.bulkCreate(require('./mock-data.json')) (Sequelize) or await prisma.user.createMany({ data }) (Prisma). In Python, use json.load() and SQLAlchemy's session.bulk_insert_mappings(). For direct SQL, tools like pgfutter (Postgres) or MySQL's LOAD DATA INFILE with a JSON-to-CSV conversion can bulk-insert JSON files efficiently.