Generate SQL statements (INSERTs) from your CSV data.
About CSV to SQL
Loading a spreadsheet into a database usually means writing INSERT statements by hand or fighting an import wizard. This tool turns each CSV row into an INSERT INTO statement, or into an UPDATE statement keyed on the first column, using backtick-quoted identifiers that MySQL and MariaDB accept and that most other engines tolerate after a quick replace.
Paste the CSV, type the table name, pick INSERT or UPDATE and copy the generated statements into your SQL client. Generation runs in your browser, so a customer list is never uploaded anywhere.
How to use CSV to SQL step by step
Paste the CSV in the left box. The header row supplies the column names.
Enter the target table name (my_table by default).
Choose the statement type: INSERT to add rows, or UPDATE to modify rows matching the first column.
Click "Generate SQL" and then "Copy" to place the statements on the clipboard.
INSERT INTO `users` (`id`, `name`, `city`) VALUES ('1', 'Ana', 'Madrid');
INSERT INTO `users` (`id`, `name`, `city`) VALUES ('2', 'Luis', 'Sevilla');
Why use our CSV to SQL?
100% free and online: no payments, no software or extensions to install.
Privacy-first: processing happens in your browser, your data never leaves your device.
No sign-up: paste your data and get the result in one click.
Fast and reliable: handle small or large files in seconds, ready for Excel and other tools.
Common use cases
Seed a development database with reference data kept in a spreadsheet.
Prepare a batch of UPDATE statements to correct prices or addresses exported from Excel.
Insert a list of users or products into a MySQL, MariaDB or SQLite table without using the import wizard.
Create a migration script for Laravel, Django or Flyway from tabular data.
Limits and tips
Every value is quoted as a string, including numbers and dates; MySQL converts them on insert, but strict engines may require removing the quotes around numeric values.
Identifiers use backticks (MySQL syntax). For PostgreSQL or SQL Server replace them with double quotes or brackets after copying.
In UPDATE mode the first CSV column is used in the WHERE clause and the remaining columns go in the SET clause, so put the primary key first.
The parser splits on commas and ignores quoted fields; values that contain commas will produce a column mismatch error in the database. Single quotes inside values are escaped as ''.
Frequently asked questions
What is the difference between the INSERT and UPDATE options?
INSERT generates one INSERT INTO statement per row and adds new records to the table. UPDATE generates one UPDATE statement per row that sets every column except the first, using the first column as the key in the WHERE clause, so existing records are modified instead of created.
Does it work with PostgreSQL or SQL Server?
The statements use backticks around table and column names, which is MySQL and MariaDB syntax. For PostgreSQL replace backticks with double quotes, and for SQL Server with square brackets; the rest of the syntax is standard SQL.
Why are numbers written in quotes?
CSV has no types, so the generator treats every cell as a string and quotes it. MySQL, SQLite and MariaDB implicitly convert '1' to 1 in a numeric column. If your engine rejects that, remove the quotes for numeric columns with a search and replace.
How do I handle NULL values?
Empty cells are inserted as empty strings (''), not as NULL. After generating the statements, replace '' with NULL where needed, or set a default in the table definition.
Is the CSV sent to a server?
No. The SQL text is built in your browser and shown in the result box; nothing is uploaded or stored.