SQL Insert Generator

Generate SQL INSERT statements from JSON or CSV data — ready-to-run INSERT queries for any database.

About SQL Insert Generator

This tool converts JSON arrays or CSV data into ready-to-execute SQL INSERT statements. It automatically detects column names, correctly quotes string values, handles NULL values, and supports multiple SQL dialects. Batch insert mode produces a single INSERT statement with multiple value rows — much faster than individual INSERTs for bulk data loading. The INSERT IGNORE option (MySQL) or ON CONFLICT DO NOTHING (PostgreSQL) skips rows that violate unique constraints rather than failing the entire batch.

FAQ

What is batch INSERT and why is it faster?
Batch INSERT combines multiple rows into one statement: INSERT INTO t VALUES (r1),(r2),(r3). This is significantly faster than individual inserts because it reduces network round trips, transaction overhead, and index rebuilding frequency. For large datasets, batch inserts can be 10-100x faster.
How are different data types handled?
Strings are wrapped in single quotes with internal quotes escaped. Numbers are inserted as-is without quotes. Booleans become 1/0 in MySQL and TRUE/FALSE in PostgreSQL. Null values become SQL NULL. Arrays and objects are JSON-serialized as strings.