SQL INSERT Generator

Runs in browser Database

Define columns and rows (or paste CSV/JSON) and produce single or multi-row INSERT statements with correct quoting for MySQL, PostgreSQL, SQL Server, Oracle or SQLite. Also supports generated test rows.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use SQL INSERT Generator

  1. Paste rows (first line = column names) or a JSON array.
  2. Enter the table name and choose the dialect and statement style.
  3. Copy the generated INSERT statements.

SQL INSERT Generator features

  • Accepts CSV/TSV with header or a JSON array of objects
  • Automatic column type inference for correct quoting (numbers, booleans, dates, NULL)
  • Multi-row INSERT with batching, or one statement per row
  • MySQL, PostgreSQL, SQL Server, Oracle (INSERT ALL) and SQLite syntax
  • Identifier quoting: only when needed, always or never
  • Optional transaction wrapper

SQL INSERT Generator example

Two rows to a multi-row INSERT

Input:

id,name,active
1,Layla,true
2,Omar,false

Output:

INSERT INTO users (id, name, active) VALUES
  (1, 'Layla', 1),
  (2, 'Omar', 0);

Frequently asked questions about SQL INSERT Generator

What input formats are accepted?

CSV or TSV with a header row (comma, semicolon, tab or pipe delimited — detected automatically) and JSON arrays of objects. Nested JSON objects are flattened into column_subcolumn names.

How are values quoted?

Column types are inferred from the data: numbers stay unquoted, booleans become TRUE/FALSE or 1/0 depending on the dialect, empty cells and NULL become NULL, and everything else is single-quoted with quotes escaped. Tick "Quote every value as text" to disable inference.

Why are rows batched?

Large multi-row INSERTs can exceed packet or parameter limits. SQL Server allows at most 1000 rows per INSERT … VALUES; the batch size splits the rows into several statements. Oracle uses INSERT ALL syntax automatically.

Can I generate seed data without a file?

Yes — type a small CSV by hand, or use the Test Data tools to generate a CSV and paste it here.

Technical notes

Column headers are normalised into identifiers: NFKD decomposition strips diacritics, camelCase is split, anything outside [A-Za-z0-9_] becomes an underscore, a leading digit gets a _ prefix, then everything is lower-cased and cut at 63 characters (PostgreSQL's limit). Auto quoting applies only when a name fails ^[A-Za-z_][A-Za-z0-9_]*$ or is a reserved word — backticks for MySQL, [brackets] for SQL Server, double quotes elsewhere, dotted names per part. The table name is quoted but never rewritten.

Per-column inference merges kinds: numeric widen integer → bigint → decimal, date with datetime gives datetime, other mixes become strings. 007 stays a string, numeric literals are copied verbatim (1.50 keeps its zero), and blank, null, N/A, \N or - become NULL. TRUE/FALSE appear only in PostgreSQL, 1/0 elsewhere. Single quotes are doubled; MySQL also doubles backslashes, SQL Server N-prefixes non-ASCII text, and Oracle receives DATE '…' and TIMESTAMP '…' literals.