Mock Data Generator
Generate fake JSON / JSON Lines / CSV / SQL INSERT records from a template. Powered by faker.
published
- [FREE]
- [NO_SIGNUP]
- [NO_UPLOAD]
A mock data generator produces realistic-looking fake user, order, log, or geographic records for testing. This tool takes a JSON template with {{token}} placeholders, runs it N times through faker, and assembles the records as JSON / JSON Lines / CSV / SQL INSERT — entirely in your browser.
How to use the mock data generator
- Pick a sample template (User, Order, Server log, Geo coordinate) or write your own JSON. Use
{{token}}placeholders where you want randomness. - Set count and output format. 1–5000 records. JSON for general use, NDJSON for streaming pipelines, CSV for spreadsheets and SQL bulk-load tools, INSERT for direct paste into psql/mysql/sqlite.
- Lock the seed (optional). Click Lock seed once and every subsequent generation with the same template uses that seed. Reproducible fixtures.
- Copy or download. Output is ready to paste, save, or import.
Template syntax
A template is a JSON object. Tokens look like {{name}} or {{name(arg1, arg2)}}. Examples:
{
"id": "{{uuid}}",
"name": "{{fullName}}",
"email": "{{email}}",
"active": {{boolean}},
"role": "{{pick(admin,editor,viewer)}}",
"age": {{number(18,80)}},
"score": {{float(0,100,2)}},
"createdAt": "{{isoDate}}"
}
After token expansion, each record must parse as valid JSON. Wrap string tokens in "…"; leave number/boolean tokens unquoted.
Token cheat sheet
| Category | Tokens |
|---|---|
| Identifiers | uuid, hex(N) |
| People | firstName, lastName, fullName, email, username, phone, jobTitle |
| Location | streetAddress, city, state, zipCode, country, countryCode |
| Business | company, jobTitle |
| Text | loremWord, loremSentence, lorem |
| Numerics | number(min,max), float(min,max,digits), boolean |
| Timestamps | isoDate, pastDate, futureDate |
| Network | url, ipv4, ipv6, mac, imageUrl |
| Choice | pick(a,b,c) — random element of the list |
Full reference (with example values) is in the tool’s Available tokens dropdown.
Output format comparison
JSON array
[
{ "id": "550e…", "name": "Ada Lovelace" },
{ "id": "1a2b…", "name": "Grace Hopper" }
]
Default. Easy to paste into a fixture file, send to JSON.parse, or upload as a single payload.
JSON Lines (NDJSON)
{"id":"550e…","name":"Ada Lovelace"}
{"id":"1a2b…","name":"Grace Hopper"}
One record per line. Streaming-friendly. BigQuery, Snowflake, DuckDB, jq, and many ETL pipelines prefer this over a single huge array.
CSV
id,name
550e…,Ada Lovelace
1a2b…,Grace Hopper
Header row included. Values with commas or quotes get RFC 4180-quoted automatically. Open in Excel, Google Sheets, or COPY straight into Postgres.
SQL INSERT
INSERT INTO users (id, name) VALUES
('550e…', 'Ada Lovelace'),
('1a2b…', 'Grace Hopper');
Single bulk insert. Identifiers that are not valid SQL get double-quoted. Booleans become TRUE/FALSE. Paste straight into a database client.
Determinism with seeds
Faker’s PRNG can be seeded. Click Lock seed and the tool generates a random 6-digit seed, locks it, and re-generates. Every subsequent generation with the same template + same seed produces byte-identical output. Useful for:
- Reproducible test fixtures (commit the seeded output to git, regenerate to verify)
- Bug repros (your colleague pastes the share link and sees the same broken data)
- Snapshot testing (use the same seed across runs)
Click Clear to drop back to fresh randomness on every generation.
When NOT to use a mock data generator
- Production data. Generated values are realistic-looking but not statistically representative of real users. Don’t use for ML training or analytics QA.
- Security testing. The values are deterministic per seed and follow faker’s distributions. Real users have edge cases (Unicode names, very long emails, mixed alphabets) faker doesn’t fully cover.
- Compliance datasets. GDPR / HIPAA test data should use officially-synthesized data from your data team, not a generic generator.
How it compares
| bytefork.tools | mockaroo.com | json-generator.com | |
|---|---|---|---|
| Runs in browser | ✓ (faker, lazy-loaded) | partial (uploads template) | ✓ |
| Count limit (free tier) | 5,000 / generation | 1,000 / day | unspecified |
| JSON / JSON Lines / CSV / SQL output | ✓ all four | ✓ + more | partial |
| Seeded determinism | ✓ | partial | ✗ |
| Sign-in required | ✗ | required for >100 rows | ✗ |
| Ad-free | ✓ | partial (free tier) | ✗ |
Privacy and security
A static HTML page with a small initial JavaScript bundle. The @faker-js/faker library lazy-loads on first generation (~1 MB raw, ~280 KB gzip). Once loaded it runs entirely in your browser tab. Templates and output never leave the page.
Related tools
- JSON to Types Generator — once you’ve generated mock data, derive types from the shape (
{{uuid}}becomesstring,{{number}}becomesnumber). - JSON Formatter & Error Reviewer — pretty-print the generated output or debug a template that’s not producing valid JSON.
- JSON to CSV Converter — alternate CSV path with more control over nested-object flattening.
Frequently asked questions
Is my template sent to a server?
No. Generation runs via the @faker-js/faker library lazy-loaded into your browser tab. Templates, generated records, and SQL output all stay on your device. Open DevTools → Network and you will see no outbound request with your input.
How does the template work?
You write a JSON object with `{{token}}` placeholders. The generator runs the template N times, replacing each token with a realistic random value, then assembles the records into the chosen output format. A template like `{"id": "{{uuid}}", "name": "{{fullName}}"}` with count 100 produces 100 records, each with a unique UUID and a random full name.
What tokens are supported?
30+ tokens covering common dev/test scenarios: identifiers (uuid, hex), people (firstName, lastName, fullName, email, username, phone), addresses (streetAddress, city, state, zipCode, country), business (company, jobTitle), text (lorem variants), numerics (number(min,max), float(min,max,digits), boolean), timestamps (isoDate, pastDate, futureDate), network (url, ipv4, ipv6, mac), images (imageUrl), and a `pick(a,b,c)` for one-of-N choice. Full table in the Available tokens section under the output pane.
How big can I generate?
Up to 5,000 records per click. At a typical 100-200 bytes per record, that is 0.5–1 MB output. For larger volumes, generate multiple batches and concatenate, or install faker locally and run a Node script (`node -e "..."`). Browser memory is the hard ceiling; 5,000 keeps the page responsive.
Are the random values deterministic?
Yes if you Lock seed. Hit New seed once and the next generation produces a specific seed; every subsequent run with the same template + seed gives the same output. Useful for reproducible test fixtures or sharing a known dataset via the share link. Click Clear to go back to fresh randomness on every generation.
What is JSON Lines (NDJSON)?
One JSON object per line, no enclosing array. Used by streaming APIs, log files, and BigQuery / Snowflake / DuckDB bulk loaders. Faster to parse line-by-line than a single huge JSON array.
How does the SQL INSERT output work?
Provide a table name and the generator emits a single `INSERT INTO table (cols…) VALUES (row1), (row2), …;` statement. Column names that are not valid SQL identifiers get double-quoted. Booleans become TRUE/FALSE, numbers stay numeric, strings get single-quoted with embedded quotes escaped. Paste straight into psql, MySQL, or SQLite.
Does this respect privacy or GDPR?
The values are randomly generated by faker — not pulled from any real-person database. They look realistic but do not correspond to actual humans. Safe to commit to repos as test fixtures or share publicly. The tool itself processes everything in your browser; nothing is logged.
Why does my template error say "did not produce valid JSON"?
After token expansion the result must parse as JSON. Common mistakes: forgetting to wrap a string token in quotes (`"id": {{uuid}}` instead of `"id": "{{uuid}}"`), missing commas between fields, unbalanced braces. The error message includes the row number that failed; check the template.
Is the mock data generator really free?
Yes. No signup, no account, no ads, no telemetry on your input. The source is on the project repository.