SQL & Databases

Mock Data Generator

Generate realistic rows for a schema as SQL, JSON, or CSV.

  • History kept on this deviceRecent results are kept in this browser's local storage until you clear them.
  • Runs in your browserProcessing happens in this page. No application server receives your input.
More options

CREATE TABLE DDL (optional)

Fields

Mock data field definitions
Column nameGeneratorNullable (0..1)UniqueActions
No fields defined. Add a field or infer from CREATE TABLE DDL.

Generated mock data

What this tool does

Generates realistic rows for a schema (names, emails, addresses, timestamps, and sequence or UUID identifiers) as dialect-quoted INSERT statements, JSON arrays, JSON Lines, or CSV. Paste a CREATE TABLE statement to infer column names, generators, nullability, and uniqueness on the main thread, or configure each field one at a time in the table editor.

Seeded generation and worker streaming

Generation runs inside the isolated sql.worker.ts Web Worker with a lazy import of @faker-js/faker/locale/en. Every run calls faker.seed(seed) and walks fields in a fixed order so identical field definitions, row counts, and seeds produce byte-for-byte identical output. Runs stream progress every 1,000 rows and check for cooperative cancellation between chunks so cancelling a 100,000-row run stops cleanly without terminating the worker.

Dialect-aware SQL quoting

  • Identifiers use dialect-specific quoting via quoteIdent ("users" for PostgreSQL, SQLite, and DuckDB; `users` for MySQL; [users] for SQL Server).
  • Literals use quoteLiteral so embedded single quotes (such as O'Brien) are doubled to 'O''Brien' and MySQL backslashes are escaped to \\.

Known limitations

Generated data is realistic rather than cross-column consistent: two rows can hold the same email unless the column is marked unique, and independent columns are drawn separately. Locale is fixed to English (en) for the entire run. A unique column whose generator cannot supply enough distinct values (such as boolean with 10 unique rows) is rejected before generation begins. The INSERT output is plain text for you to review and run deliberately; nothing here executes it or persists the generated output to browser storage.

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.