Mock Data Generator

Design a field list (or load a preset), pick how many rows and a seed, and download the rows as JSON, NDJSON, CSV or SQL INSERT statements. The same seed and settings give the same data every time, and the first rows can carry the awkward values importers trip over. Everything is generated inside your browser.

Mock Data Generator

How it works

  1. Choose a preset (People, Orders, Products, Events), which loads its fields, or add fields: a name, a type such as full name, e-mail, date, integer or one-of-a-list, the type's options, an empty share and whether values must be unique. Once you have edited the fields, a preset chosen in the menu waits for Load preset, so your edits are not replaced by accident; a link such as ?mock-preset=orders loads that preset.
  2. Set the number of rows (up to 100,000), a seed, the output format and, for SQL, the table name.
  3. Press Generate data, check the first ten rows in the preview, and download the file.

Questions

Is the data reproducible?

Yes. The rows are computed from the seed and the field list with a small deterministic random generator (mulberry32), so the same seed, fields, options, row count and edge-case setting give exactly the same rows on any device and on any day: nothing is read from the clock, and a date or date-and-time range left blank always means 2024-01-01..2026-12-31. Change the seed and the random values change. Type-in seeds can be any text; a whole number from 0 to 4,294,967,295 written only with the digits 0-9 (10 at most) is used as it is, and anything else is turned into such a number.

What are the edge cases?

With the box ticked, the first four rows carry boundary values instead of random ones: in text fields an empty value (a job title), a value with an apostrophe, quotes, a comma, an ampersand and angle brackets, a value with accented letters and Chinese characters (Zoë D'Arcy-Nguyễn 王小明) and a long one (a company of 255 characters); in name fields Zoë O'Brien, Jean-Luc Müller-Nguyễn, O'Neil van der Berg and 伟 李; in integer, decimal, date and date-and-time fields the minimum and the maximum of the range and a value between them, and in date fields also a leap day where the range has one; in a list its first and last value. Words keep their word count: the fewest words of the range, then the most, written with the same awkward words, so a range of 0..0 stays empty. They are meant to find import and display bugs early; untick the box and the first rows are made like the rest.

How are unique fields and empty values handled?

A unique field never repeats a value. Before anything is generated the tool checks that the type can supply enough distinct values for the rows that need one (for example a unique integer 1..50 cannot fill 60 rows) and refuses with a message naming the field. Empty % sets the share of rows in which the field is null (an empty cell in CSV, NULL in SQL): exactly that share, rounded to the nearest row, so 10 % of 25 rows is 3 empty rows. Unique and empty can be combined: only the non-empty rows must differ. A unique field with few possible values, such as a city or a number from 1 to 50, uses each value at most once, so a request that fits always completes. The name fields of a row show one person, and its city, country and country code one place, so unique name and place fields are planned together before anything is generated: where several of them are filled in, the row's person or place must be new to each. One such field, two that show the same thing (two first-name columns, or a country and a country code) and a city with a country or a country code always fit when each fits alone; for other combinations the tool looks for a choice of values that meets every field and refuses before generating, naming the fields, when it finds none.

How do ranges, decimals and word counts work?

Integer, decimal, date and time ranges include both ends. Left blank, a range means 0..100 for an integer, 0..100:2 for a decimal and 2024-01-01..2026-12-31 for a date or a date and time, and the options box shows it. A decimal range such as 0..10:2 gives values with at most 2 decimals that lie inside the range; a range that holds no such value, for example 0.001..0.002 with 2 decimals, is refused with a message instead of producing values outside it, and so is one whose values would need more than 15 significant digits (90071992547409.85..90071992547409.91:2, for example), which would be rounded when written out. Whole numbers, in an integer range or as the start of a row number, go up to 9,007,199,254,740,991, and row numbers that would pass it are refused. Words take a min..max count from 0 to 100 words, and 0 gives empty text. In edge-case rows, the minimum and maximum of each range appear first, word counts included.

Is any of this real data?

No. Names are drawn from short invented lists of first and last names from many regions, cities and countries are real places but attached to made-up people, companies are random word pairs (in edge-case rows, the awkward values above), phone numbers use the reserved 555 range and e-mail addresses use the example.com, example.org and example.net domains reserved for documentation, so no message can reach a real person. The SQL file starts with a comment saying so. Nothing you design here is stored or uploaded.

Does Excel show accented and Chinese letters in the CSV file correctly?

Yes. The CSV file is UTF-8 and starts with a byte order mark, the mark Excel needs to read accented and Chinese letters in a CSV file, so they show as they are when the file is double-clicked. The JSON, NDJSON and SQL files have no mark: the programs that read them take UTF-8 without one. A program that does not recognise the mark may read it as part of the first column name; in Python, the encoding utf-8-sig reads it away.

What is not in this version?

Related tables (parent and child rows sharing keys), custom patterns or regular expressions, statistical distributions other than uniform (apart from a list's weights and a boolean's share of true values), and saving a field list for later. One table at a time, up to 100,000 rows; larger counts are refused rather than freezing the page.

Is anything uploaded?

No. The page loads a small script into your browser and every calculation runs on your device. You can check this yourself in the browser's network panel: after the page has loaded there are no upload requests. Closing the tab discards what you entered.

Do I need an account or to pay?

No. These basic tools are free and store nothing on our servers. The only limits are the tool's own: up to 100,000 rows per file, one table at a time.

What does this page keep in my browser?

Nothing you open or type. While the tab is open, the tool pages keep a short list of the steps taken in it, in the tab's session storage: the step (page opened, started, succeeded, first success, used again or failed), the tool's name, the time, how many files were used and, for a failure, an error code; never a file name, the contents of a file or your text. It holds at most the latest 200 steps, and the browser deletes it when the tab closes. The page never sends it. Where a Report a problem button is shown, you can attach the last 20 steps to your report; nothing is attached unless you tick that box. In local storage the page keeps only choices you made: a Light or Dark theme until you choose System again, the language you picked with the EN / 中文 switch if it differs from your browser's language, and this tool in your recently used list if you switched that list on at the tools page.

Questions or problems

Found a problem or missing feature? Tell us. Please describe the steps; do not send confidential data.