Mock Data Generator Complete Guide: Generate Test Data Fast
Why You Need a Mock Data Generator
Integration work, UI debugging, demos, and light load checks all need rows of test data. Hand-writing them is slow, repetitive, and often mismatched with real field shapes.
The Mock Data Generator builds multi-row fake datasets from field types you select. Rename columns, pick a locale, set an optional seed, and export JSON, CSV, TSV, YAML, or SQL — all in the browser, nothing uploaded.
Common pain points
- Backend APIs are not ready, so the frontend cannot integrate — generate a matching batch first
- Tests need many field types; after generation, sanity-check JSON with the JSON formatter
- Demo data looks fake and weakens the presentation
- Hundreds of rows for scroll or import drills are unrealistic to type by hand
What the tool provides
Field types
Thirty-two field types across seven categories:
| Category | Examples | Typical use |
|---|---|---|
| Basic | Chinese/English names, gender, age, boolean, username, phone, email, ID card, address, company | User tables, profiles |
| Network | IPv4/IPv6, URL, domain, User-Agent | Logs, gateway stubs |
| Date & time | Random / past / future dates, timestamps | Sorting and filters |
| Numbers | Integer, float, percentage | Charts and reports |
| Text | Random string, Lorem, Chinese filler | List titles and body copy |
| Identifiers | UUID/GUID, order number, bank card | Primary keys, payment demos |
| Color | HEX, RGB | UI placeholders |
When you only need structure and not meaningful fields, the lighter JSON generator is enough. Prefer this tool for emails, phones, names, and similar typed columns.
Locale samples
Locale reshapes phone, address, company, and gender labels:
- Chinese / CN: 11-digit mobile prefixes, province/street addresses, Chinese gender labels
- English / US:
+1 (area) xxx-xxxxphones, US city streets and ZIP-style codes, English company and gender wording
Chinese and English name types stay independently selectable, so you can mix bilingual UI cases (for example English locale with Chinese names).
Seeds for reproducible fixtures
Leave the seed empty for fresh randomness. Set any string (for example fixture-users-v1) and keep fields, row count, locale, and format unchanged to regenerate the same output. That helps with:
- Frontend golden / snapshot tests
- Stable samples in pull requests
- Copy-paste examples in docs and tutorials
Changing column names or row count with the same seed changes the result — the seed covers the whole generation request, not a single field.
Export formats
| Format | Good for |
|---|---|
| JSON | Mock servers, frontend fixtures, then JSON to TypeScript |
| CSV / TSV | Spreadsheets and pipelines; convert with CSV↔JSON |
| YAML | Config-style mocks and some CI fixtures |
| SQL | INSERT INTO mock_data (...) VALUES ... — rename the table before loading |
Row count is capped at 1–1000. Validate column shapes on a small batch before scaling up.
Scenarios
Parallel frontend work
- Select fields and rename columns to match the API (
userId,createdAt, …) - Set a seed when you need reproducibility, export JSON
- Point the UI at the local mock; switch the data source when the API lands
List layout and edge feel
Mix long text types (Lorem, Chinese filler) with short fields (boolean, age) to exercise wrapping, empty states, and sorting. For pure layout texture, pair with the Lorem generator.
Local database seeding
Export SQL and check table/column types before running it in a dev database. Booleans become TRUE/FALSE. Do not load PII-shaped random values into production.
Practical tips
- Name columns first so fixtures match the real API contract.
- Start small: 10–20 rows for UI; hundreds for scroll; this tool stops at 1000 — use server scripts for heavier load tests.
- Pick locale for the audience: CN phones/addresses for domestic demos; English/US for international walkthroughs.
- Use a seed for stable samples in docs, CI, and review threads.
- Stay compliant: format-like fake data is still not real people — keep it out of production.
Mock Data vs China test-data tools
This generator is a generic multi-field table builder. When you need China-specific identifiers in bulk with stronger region/BIN coverage, use the dedicated China test-data generator and validators (ID card, credit code, plate). Overlap is intentional:
| Need | Prefer |
|---|---|
| Mixed user rows (name + email + UUID + dates) for UI mocks | This mock generator |
| Syntactically valid CN ID / bank card / USCC batches | China test-data tools |
| Check whether a pasted number passes checksum | Format validators on the same cluster |
ID-card values here now use GB 11643 MOD 11-2 check digits; bank cards use Luhn against public test BINs. They still map to no real person or account—checksum-valid is not “issued-valid.”
Seed hygiene and fixture collisions
A seed only freezes randomness for the exact request: field keys, column names, count, locale, format, and (for time-ish fields) the wall clock injected at generation. Teams trip over three patterns:
- Renaming a column while keeping the seed — output changes because field specs are part of the digest inputs
- Sharing one seed across environments with different default locales — CN vs US phones diverge even when the seed string matches
- Snapshotting SQL then editing the table name by hand — fine for loading, but regenerate from the tool when columns change so quotes/escaping stay consistent
Name seeds after the fixture (fixture-users-v2), not after a person (alice-laptop). Put the seed in the PR description when you paste sample JSON.
Honest limits
- Output is a flat row of fields, not an arbitrary nested JSON tree. Assemble nesting in code if you need deeper structures.
- Fields are independent (order time is not guaranteed after signup time); add relationships in your test helpers.
- Checksum-valid ID/bank numbers are still synthetic — never load them into production, and do not treat them as proof that a real document exists.
Closing
Moving data fabrication out of hand-written fixtures speeds up mocks and demos. ToolVault's Mock Data Generator covers dozens of field types, locale samples, seeds, and multiple export formats, entirely on the client. When you need a schema contract, generate JSON and validate with the JSON Schema tools next.
Triage notes
'Seed hygiene' gets a section of its own with three traps because a seed only freezes the randomness of one request — fields, row count, locale, and format are all generation inputs, so renaming columns while keeping the seed still changes the output; hence the conventions of naming seeds after fixtures and pasting the seed alongside samples in PRs, defending against 'it generates differently on my machine'. The three items 'Honest limits' states as-is — flat row objects, no cross-field business relationships, a passing checksum not meaning a genuinely issued number — mark exactly the range the tool takes responsibility for; complex correlations go back to test code for a second pass. The first practical tip, define columns before generating, follows the same logic: align column names with the real API up front and save both ends the renaming round trip.
Related Tools
Related Articles
Regex Matches Nothing / Greedy .* Swallows Results — How to Fix
Online regex test matches nothing, or greedy .* eats too much, or groups capture nothing? Explains greedy vs lazy, escaping special chars, and anchors — with a step-by-step debug using our regex tester.
API Testing: How to Send a Token and Fix CORS Errors
How to add an Authorization token when testing APIs online, and what to do about CORS / 405 / timeout errors? A step-by-step troubleshooting guide with our API tester.
JSON to TypeScript: Complete Guide to Auto-Generating Type Definitions
Step-by-step tutorial on how to quickly convert JSON data to TypeScript interfaces and type definitions, boosting development efficiency and code quality