How to Generate Realistic Test Data Without Using Real Customer Data

Why production data does not belong in development, how to design mock datasets, what seeds do for reproducible fixtures, and how to export JSON, CSV or SQL.

Updated September 29, 2026 6 min read

Use the free Fake Data GeneratorGenerate sample rows of names, emails, addresses and more as JSON, CSV or SQL

You are building a customer table, a signup form or an admin dashboard, and you need something to put in it. An empty screen tells you nothing about how the layout copes with long names, how the table paginates, or how the export looks. The tempting shortcut is to copy a few thousand rows from production. It is also the one that most often ends up in an incident report.

This guide explains why invented data is usually the better choice, what makes a mock dataset genuinely useful, how seeds keep test data stable, and how to produce rows as JSON, CSV or SQL without writing a generator yourself.

Why not just copy production data?

Real records bring real obligations. Customer names, emails, addresses and phone numbers are personal data under privacy laws such as the GDPR, and those rules do not relax because a copy lives on a developer's laptop or in a staging database. Development environments tend to have weaker access controls, more people with access, more third-party tools attached and less logging. A leaked staging dump is still a leak.

There are practical problems too:

  • Accidental contact. A test run that sends "welcome" emails or SMS messages to real addresses is embarrassing and hard to undo.
  • Size and noise. Production tables are large and full of history you do not need for a UI test.
  • Unstable fixtures. Real data changes; tests that depend on "customer 4812" break when that record is edited.

Anonymising production data is possible, but it is harder than it looks, because combinations of fields (postcode, birth date, job title) can re-identify people. For most development and demo work, data that was never real in the first place is simpler and safer.

What makes test data useful

Random strings like asdf123 fill a table but do not test much. Good mock data looks like the real thing in the ways that matter:

  • Realistic shapes. Names of varying length, emails that look like emails, dates in the right format, prices with two decimals. That is what catches truncation, wrapping and validation bugs.
  • Consistency within a row. An email that matches the person's name makes screenshots and demos believable.
  • The right types. Numbers stored as numbers, booleans as booleans, so sorting and filtering behave like production.
  • Safe values. Emails at reserved example domains and phone numbers in fictional ranges cannot reach anyone.
  • Reproducibility. The same input gives the same rows, so a failing test can be re-run and debugged.

Seeds: random but repeatable

Computers generate "random" numbers with a pseudo-random number generator (PRNG): a formula that produces a sequence that looks random but is fully determined by its starting value, the seed. Use the same seed and you get exactly the same sequence, and therefore the same rows.

This small JavaScript example shows the idea with the mulberry32 generator:

// mulberry32: a tiny seeded pseudo-random generator
function mulberry32(seed) {
  return function () {
    seed = (seed + 0x6d2b79f5) | 0;
    let t = Math.imul(seed ^ (seed >>> 15), 1 | seed);
    t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
    return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
  };
}

const cities = ["Leeds", "Porto", "Lyon", "Austin", "Pune"];
const rand = mulberry32(12345);
const rows = Array.from({ length: 3 }, (_, i) => ({
  id: i + 1,
  city: cities[Math.floor(rand() * cities.length)],
  credit_limit: Math.round(rand() * 5000),
}));
console.log(rows); // identical output on every run with seed 12345

Math.random() cannot be seeded, which is why test-data libraries ship their own generators. Note that seeded PRNGs are for test data only; never use them for passwords, tokens or anything security-related.

Generate a dataset in the browser

The Fake Data Generator builds rows from a list of fields you define, entirely on your device.

  1. Open the Fake Data Generator. It starts with six sample fields: id, name, email, company, signup_date and active.
  2. Edit each field name to match your column names, and choose a type from the list next to it. Types include Row ID, UUID v4, first, last and full name, Email, Username, Phone (fictional 555), Street address, City, Postal code, Country, Company, Job title, Date, Date-time (ISO 8601), Integer, Decimal, Price, Boolean, Colour name, URL, IPv4 (private range), and Lorem sentence or paragraph.
  3. Click Add field for more columns, use the arrows to reorder them, and the bin icon to remove one.
  4. Set Rows (1–5000) and a Seed. The dice button picks a random seed; keep the same seed whenever you need the same data again.
  5. Choose the output tab: JSON, CSV or SQL. For SQL, enter the Table name.
  6. Copy the result or download it as fake-data.json, .csv or .sql.

Name-based fields share one invented person per row, so the email and username match the full name. SQL output is written as multi-row INSERT statements, split into batches of 500 rows, with quotes escaped and booleans as TRUE/FALSE.

Loading the data where you need it

  • JSON suits API mocks, front-end fixtures and seeding document databases. Keep a file such as fixtures/customers.json in the repository.
  • CSV opens in spreadsheets and imports into most databases (COPY in PostgreSQL, LOAD DATA in MySQL, or an import wizard). If you need a different shape, JSON to CSV and CSV to SQL convert between formats.
  • SQL can be run directly against a development database. Check that the column types in your table match: a BOOLEAN column is needed for TRUE/FALSE values, and date strings should go into a date column.

Other ways to create test data

  • Code libraries such as Faker (available for JavaScript, Python, PHP and other languages) are the best choice when data generation belongs in your test suite or seed scripts. They offer many locales and field types, and running them in CI keeps everything automated.
  • Database functions such as PostgreSQL's generate_series can create millions of rows quickly for performance testing, though the values are less realistic.
  • Spreadsheet formulas with RANDBETWEEN and lookup lists work for small, one-off samples.
  • A browser generator is fastest when you need a file right now for a demo, a bug report, a design mockup or a quick import test.

Tips and pitfalls

Include edge cases deliberately

Generated data tends to be well behaved. Add a few hand-written rows with very long names, apostrophes (O'Neil), accented characters, empty optional fields and dates at month ends. Those are the cases that break things.

Keep IDs predictable

A simple incrementing ID is easiest to reference in tests. If your schema uses UUIDs, generate them too, but note that tests referring to specific records need stable seeds. The UUID generator is useful for one-off IDs, and there is a separate guide on what a UUID is and when to use v4.

Placeholder text is not content

Lorem ipsum is fine for layout, but it hides problems with real-length copy. For text-heavy UI, test with sentences of realistic length as well; the Lorem Ipsum generator can produce paragraphs of set lengths.

Label test data clearly

If generated rows might ever be seen by others, use obviously fictional company names and example domains, so nobody mistakes a demo database for real customers.

Frequently asked questions

Is fake data safe to share publicly?

Invented values from reserved example domains and fictional number ranges do not identify anyone, so they are generally safe for demos, docs and bug reports. Still check that no real records were mixed in by hand.

What does the seed do in a data generator?

It sets the starting point of the pseudo-random sequence. The same seed and field setup always produce the same rows, which keeps test fixtures stable.

How many rows can I generate?

The browser tool produces up to 5,000 rows at a time. For larger volumes, use a code library or database functions in a script.

Can I generate data in my own language or country format?

The browser tool uses a single built-in set of names and places. Libraries like Faker support many locales if you need country-specific addresses or phone formats.

Should test data go into version control?

Small fixture files, yes, because tests depend on them. Large generated datasets are better recreated from a seed or script than stored.

Try it now: Fake Data Generator

Loading tool…