How to Generate Fake Data for Testing
Updated 2026-06-21
To generate fake data for testing, define the columns you need (such as full name, email, and address), choose how many rows to create, and export the result as JSON, CSV, or SQL. The Mock Data Generator does this entirely in your browser, so the synthetic records never touch a server.
Realistic placeholder data lets you seed a database, populate a UI, or stress-test a CSV importer without exposing real customer information. Because the data is fabricated, you sidestep the privacy and compliance problems that come with copying production records into a test environment.
Build your dataset in three steps
- Add columns. Each column has a name (used as the JSON key, CSV header, and SQL column) and a type. Pick from realistic field types including full name, first name, last name, email, phone, street address, city, country, company, job title, UUID, number, boolean, ISO date, lorem sentence, and URL.
- Set the row count. Enter how many records you want, up to 1,000. The cap keeps generation instant and your browser tab responsive.
- Choose a format and export. Generate, then copy or download the output as JSON, CSV, or SQL.
For a typical user table you might add columns named id (UUID), name (Full name), email (Email), city (City), and signup (Date). One click produces a clean array of fake users ready to drop into your fixtures.
Pick the right output format
- JSON comes out as a pretty-printed array of objects with native types preserved — numbers and booleans stay unquoted, so it parses cleanly into your test suite or mock API.
- CSV includes a header row and follows RFC 4180 escaping (fields with commas, quotes, or line breaks are quoted correctly), so spreadsheets and importers read it without breaking.
- SQL emits one INSERT INTO statement per row. Set a table name and the columns are quoted as safe identifiers, ready to paste into a seed script.
The column order you define is preserved across every format, so keys and headers always line up with your schema.
Tune numbers and avoid common pitfalls
For a Number column you can set a minimum and maximum to keep values in a realistic range — ages between 18 and 90, or prices between 1 and 500, for example. If you leave the bounds blank they default to a 0–1,000 range, and inverted bounds are swapped automatically rather than producing empty output.
A few things to watch:
- Every column needs a unique, non-blank name. Duplicate or empty names are flagged before anything generates, so you never get a malformed file.
- Match the type to the assertion you're testing. Use ISO Date columns when your code parses timestamps, and Boolean columns for flags — don't force everything into strings.
- Don't reuse fake emails as real addresses. The values look plausible but are randomly assembled and not deliverable.
Why generate it locally
Everything runs client-side in your browser. No data is uploaded, there's no signup, and nothing is logged — so even though the records are fake, your schema and intent stay private.
Ready to seed your next test run? Open the Mock Data Generator and build your fixtures in seconds.