ZapKit

CSV & JSON to SQL INSERT Generator

Paste rows as CSV or JSON and get ready-to-run INSERT statements for your database, with quotes escaped and empty cells as NULL.

What is a SQL INSERT generator?

An INSERT statement adds rows to a database table. Writing them by hand for more than a few rows is slow and error-prone, especially quoting text, escaping apostrophes and remembering NULL for missing values.

This generator turns data you already have, a CSV export or a JSON array from an API, into valid INSERT statements for PostgreSQL, MySQL, MariaDB, SQLite, Oracle or SQL Server. Developers use it to seed test databases, write migration scripts, move a spreadsheet into a table, and share reproducible test data in bug reports.

How to use the CSV

  1. 1.Paste the rows

    CSV with a header row, or a JSON array of objects.

  2. 2.Set the table and dialect

    Name the table and choose how column names are quoted for your database.

  3. 3.Copy the SQL

    Optionally include a CREATE TABLE with column types guessed from the data.

Example: three customers from a CSV

Columns id, name, email, balance, active, where Sam O'Neil has an empty balance:

Row 1
(1, 'Priya Rao', 'priya@example.com', 1250.50, TRUE)
Row 2
(2, 'Sam O''Neil', 'sam@example.com', NULL, FALSE)
Row 3
(3, 'Li Wei', 'li@example.com', 98, TRUE)
Statement
INSERT INTO "customers" (…) VALUES with 3 rows

The apostrophe is escaped, the empty balance becomes NULL and numbers stay unquoted.

Values written correctly

Text is wrapped in single quotes with any apostrophes doubled, so O'Neil becomes 'O''Neil' and can't break the statement. From CSV, plain numbers, true and false, and the word NULL are written without quotes; empty cells become NULL unless you turn that off. JSON values keep their types, and nested objects are stored as JSON text.

A single multi-row INSERT is much faster to run than one statement per row. For very large imports, use your database's bulk loader, such as COPY in PostgreSQL or LOAD DATA in MySQL.

Frequently asked questions

Which column types does CREATE TABLE use?

INTEGER, DECIMAL, BOOLEAN or DATE when every value fits, otherwise TEXT. Review them before running it.

How are apostrophes handled?

Each ' inside a value is doubled, the standard SQL escape, so names like O'Neil insert correctly.

Can I use a schema name?

Yes. Type it as schema.table; each part is quoted separately.

Is there a row limit?

No fixed limit, but some databases cap the size of one statement. Untick One INSERT with many rows for huge files.

More Developer tools