CSV to SQL Converter
CSV to SQL Converter
Paste CSV data and get SQL INSERT statements for your table. The first row is used as the column names, empty cells become NULL, and single quotes are escaped properly.
Your SQL INSERT statements will appear here.
About the CSV to SQL Converter
The CSV to SQL Converter turns spreadsheet data into SQL INSERT statements you can run in your database. Paste CSV text, give the table a name, and the tool writes one INSERT statement per row, using the first row as the column names.
It parses CSV properly: fields wrapped in double quotes can contain commas, line breaks, and doubled double quotes. Empty cells become NULL, plain numbers stay unquoted, and text values are wrapped in single quotes with any single quote inside doubled, which is the standard SQL way to escape it.
How to use
- Paste your CSV in the box. The first row must contain the column names.
- Type the name of the table the rows belong to.
- Click Convert to SQL.
- Use Copy SQL to copy the statements, or Download .sql to save them as a file.
Key features
- One INSERT statement per row, with the header row used as column names
- Proper CSV parsing, including quoted fields with commas and line breaks
- Single quotes escaped by doubling, and empty cells turned into NULL
- Numbers left unquoted, text safely quoted
- Copy and download as a .sql file
Frequently asked questions
Yes. The first row is always read as the column names. If your CSV has no header row, add one first, for example name,email,age.
An empty cell becomes NULL in the INSERT statement, so the database stores a real null value instead of an empty string.
A single quote inside a value is doubled, so O’Brien becomes ‘O”Brien’ in the SQL. That is the standard SQL escape, and it keeps the statement valid.
The table name must start with a letter or underscore and contain only letters, numbers, and underscores, for example customers or order_items. Anything else is rejected with a clear message.
Yes, as long as the field is wrapped in double quotes, for example “Lovelace, Ada”. The parser keeps quoted commas inside the field instead of treating them as separators.
No. The conversion runs entirely in your browser and your CSV is never sent to a server.
