CSV to SQL INSERT generator
Turn CSV rows into ready-to-run SQL INSERT statements for any database.
CSV to SQL INSERT generator
Paste a CSV export and get back SQL INSERT statements you can run against MySQL, PostgreSQL, SQLite or SQL Server. It is the quickest way to seed a table from a spreadsheet, load fixture data for tests, or move a client's export into a real database without opening an import wizard. Set the table name, paste the rows, and copy the statements straight into your query tool.
The parser follows RFC 4180, so a field wrapped in double quotes may contain the delimiter, doubled "" quotes and even line breaks without breaking a row. Values are quoted the way SQL expects: whole numbers and decimals stay unquoted, an empty cell becomes NULL, and everything else is wrapped in single quotes with any apostrophe doubled — so a name like O'Brien is escaped correctly instead of ending the string early. Because the values are read as text, leading zeros in postcodes and product codes are preserved.
"First row is column names" uses your header for the column list; switch it off and the columns become col1, col2 and so on. Choose the delimiter that matches your file — comma, semicolon (common in European exports) or tab. Turn on "Combine into one multi-row INSERT" and every row is batched into a single INSERT INTO t (…) VALUES (…),(…),(…); statement, which loads far faster than one statement per row on large imports.
Everything runs in your browser and nothing is uploaded, which matters when the export holds customer records or internal data. Copy the SQL, download it as a .txt file, or send the result to another tool to keep working. Review the generated statements before running them on a production database.