Runs 100% in your browser — nothing is uploaded
Converters

CSV → SQL Insert Generator

Turn CSV data into batched INSERT statements for MySQL, PostgreSQL, SQLite, or SQL Server.

CSV → SQL Insert Generator
Client-side

About this tool

The CSV → SQL Insert Generator parses CSV data — pasted or typed, first row as header — and produces ready-to-run INSERT statements for four SQL dialects: MySQL, PostgreSQL, SQLite, and SQL Server. This is the tool for seeding a test database from a spreadsheet export, migrating a small dataset without writing an ETL script, or quickly turning a CSV a stakeholder emailed you into rows you can paste directly into a SQL client.

Set a table name, pick a dialect — this mainly changes identifier quoting: backticks for MySQL, double quotes for PostgreSQL and SQLite, square brackets for SQL Server — and a batch size controlling how many rows go into each INSERT statement. A preview table shows the first 5 parsed rows before you generate SQL, so you can catch a wrong delimiter or misaligned header before generating thousands of lines.

Values are escaped for safety: single quotes inside strings become doubled single quotes, and values that look like plain integers or decimals are emitted unquoted as numeric literals. An "use NULL for empty cells" toggle lets you choose whether blank CSV cells become SQL NULL or empty strings. Parsing uses PapaParse entirely in your browser.

FAQ

Which SQL dialects are supported and what actually changes between them?
MySQL, PostgreSQL, SQLite, and SQL Server. The main difference is identifier quoting: MySQL uses backticks, PostgreSQL and SQLite use double quotes, and SQL Server uses square brackets.
How does batch size affect the output?
Batch size controls how many value rows are grouped into a single multi-row INSERT statement. Smaller batches are more resumable if an import fails partway; larger batches are faster to execute.
How are single quotes and special characters in my data handled?
Single quotes inside string values are escaped by doubling them, the standard SQL string escape.
What happens to empty CSV cells?
By default, an empty cell becomes an empty string. Toggle "use NULL for empty cells" to instead emit the SQL keyword NULL for blank cells.
Does this tool validate that my column count matches every row?
The underlying CSV parser flags structural issues like mismatched field counts. Use the 5-row preview table to visually confirm columns line up before generating the full statement set.