Codepackr / utilities / Advanced Mock Data Generator

Advanced Mock Data Generator

Generate realistic mock data records with custom schema fields, exported as JSON, CSV, or SQL INSERT statements.

Client-Side Execution & Privacy Guarantee

This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.

Realistic test data is essential for UI prototypes, API contract tests and database seeding, yet hand-writing dozens of records is tedious and error-prone. This generator lets you describe a schema—field names, data types, optional constraints and sample values—and then produces as many conforming records as you need.

Supported types include strings, integers, floats, booleans, dates, UUIDs, emails, names and nested objects. You can set minimum and maximum lengths or numeric ranges, mark fields as unique, and supply an explicit list of allowed values. The finished dataset can be copied as pretty-printed JSON, downloaded as CSV, or emitted as SQL INSERT statements ready for a relational database.

Defining a schema

Each field is given a name and a type. Primitive types are generated with sensible defaults: strings receive random words, integers fall inside a configurable range, dates fall between two bounds, and UUIDs follow RFC 4122 version 4. For categorical data you can supply an array of allowed values; the generator picks from that list uniformly.

Nested objects and arrays are expressed by embedding further field definitions. This lets you produce documents that match the shape expected by a front-end component or an API response schema without writing custom faker code.

Constraints and uniqueness

Numeric fields accept min and max bounds. String fields accept minLength and maxLength. When the unique flag is set the generator tracks previously emitted values for that field and retries until a fresh value is obtained (or reports that the constraint cannot be satisfied for the requested volume).

Date fields can be restricted to a closed interval. Email and name generators use realistic patterns so the output is immediately usable in forms and email-validation tests.

Export formats

JSON is the default and preserves full nesting. CSV flattens one level of nesting by concatenating parent and child names with a dot; deeper structures are serialized as JSON strings inside the cell. SQL output produces a single INSERT statement (or a batch of them) with properly escaped literals, suitable for pasting into a query window.

Because generation occurs entirely in the browser you can create thousands of rows without uploading any schema or data to a remote service.

When to use this tool

  • Populating a front-end prototype with varied, realistic records before the back-end exists
  • Creating fixture data for unit or integration tests that must cover edge values
  • Seeding a development database with a known volume of rows
  • Demonstrating an API response shape to stakeholders without exposing production data
  • Generating CSV files for import tests of data-processing pipelines

How to use the Advanced Mock Data Generator

  1. Add fields one by one, choosing a type and optional constraints for each.
  2. For enumerated fields paste or type the allowed values.
  3. Set the number of records you need (from 1 to several thousand).
  4. Click Generate; the result appears instantly in the preview pane.
  5. Switch the export format to JSON, CSV or SQL and copy or download the output.
  6. Adjust any constraint and regenerate; the previous schema is retained so iteration is fast.
  7. If a uniqueness constraint cannot be met the tool reports how many distinct values were possible.

Worked examples

Simple user records

Input
fields: id (uuid), name (string), email (email), active (boolean); count: 2
Output
[
  {"id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","name":"Alex Rivera","email":"alex.rivera@example.com","active":true},
  {"id":"b2c3d4e5-f6a7-8901-bcde-f12345678901","name":"Sam Chen","email":"sam.chen@example.com","active":false}
]

UUIDs and emails are freshly generated on each run; the shape remains identical.

Numeric range and SQL export

Input
fields: product_id (integer, min 1000, max 9999, unique), price (float, min 0.99, max 49.99); count: 1; format: SQL
Output
INSERT INTO mock_data (product_id, price) VALUES (4821, 12.47);

The integer is guaranteed to lie inside the stated range and to be unique across the generated set.

Common mistakes and tips

  • Start with a small count while you refine the schema, then increase the volume once the shape is correct.
  • Mark only the fields that truly must be unique; excessive uniqueness constraints slow generation and may become impossible.
  • For CSV export keep nesting shallow; deeply nested objects become JSON strings and lose tabular convenience.
  • SQL output escapes single quotes and backslashes, but you should still review the statement before executing it against a shared database.
  • The generator uses a seeded pseudo-random source when you supply a seed, making the same schema produce identical data on every run—useful for reproducible tests.

Frequently asked questions

Are the generated emails and names real?

No. They are synthetic values that follow realistic patterns. No actual personal data is used or produced.

Can I generate nested JSON?

Yes. Define an object or array field and supply child field definitions; the generator recurses to the depth you specify.

What happens if I ask for more unique values than are possible?

The tool stops and reports the maximum number of distinct values that satisfy the constraints.

Does the SQL use a particular dialect?

The INSERT syntax is standard and works in PostgreSQL, MySQL, SQLite and SQL Server with only minor adjustments for identifier quoting.

Is any schema or data uploaded?

No. Schema definition and record generation occur entirely inside the browser.