CSV to SQL INSERT Generator
Paste CSV and turn each row into a SQL INSERT statement. Choose the target table name, whether the first row is a header, and the delimiter. Values are quoted and escaped safely, numbers stay bare, and empty cells become NULL.
How to convert CSV to SQL
- Paste your CSV, including the header row if you have one.
- Enter the target table name and pick the delimiter and header options.
- Copy or download the generated INSERT statements.
Examples
Header row to inserts
name,age Ada,36 Linus,54
INSERT INTO my_table (name, age) VALUES ('Ada', 36);
INSERT INTO my_table (name, age) VALUES ('Linus', 54);Custom table with an empty cell
id,email 1, 2,ada@example.com
INSERT INTO users (id, email) VALUES (1, NULL); INSERT INTO users (id, email) VALUES (2, 'ada@example.com');
Frequently asked questions
How does it decide what to quote?
Each cell is treated as text. Plain numbers like 36 or -3.5 are left bare, empty cells become NULL, and everything else is wrapped in single quotes. Values with leading zeros, such as a zip code 01234, stay quoted strings so they are not turned into a different number.
Are single quotes and special characters handled?
Yes. Single quotes inside a value are doubled, so O'Brien becomes 'O''Brien', which is the standard SQL escaping. Commas inside a quoted CSV field are kept as part of the value rather than splitting the column.
What if my CSV has no header row?
Turn the header option off and the columns are named col1, col2, col3 and so on, one per field. With the header on, the first row supplies the column names instead.
Which SQL dialect does the output use?
It produces plain INSERT INTO table (columns) VALUES (...) statements that run on standard SQL and common databases like PostgreSQL, MySQL, SQLite and SQL Server. Table and column names are sanitized to letters, digits and underscores so the identifiers are safe.
Is my data private?
Yes. Conversion happens entirely in your browser. Nothing you paste is uploaded, logged or stored on a server.
Related tools
CSV to JSON
Convert CSV to JSON online. Turn spreadsheet rows into clean JSON objects or arrays, with smart number and boolean typing. Free tier plus API.
JSON to SQL
Convert JSON to SQL INSERT statements online. Paste an array of objects, set a table name, and get ready-to-run INSERTs. Runs in your browser.
SQL Formatter
Format and beautify SQL online. Put clauses on their own lines, indent the column list and uppercase keywords. Fast and runs in your browser.
Binary to Decimal
Convert binary to decimal online. Paste any binary number, with or without spaces, and get the exact base-10 value instantly. Runs in your browser.
Binary to Hex
Convert binary to hexadecimal online. Paste a binary number and get exact hex, with optional uppercase. Handles huge values. Runs in your browser.
Celsius to Fahrenheit
Convert Celsius to Fahrenheit instantly. Type a temperature in C and get F, with the formula and a quick reference table. Runs in your browser.