CSV to SQL Converter
Generate SQL INSERT statements, and optionally a CREATE TABLE with inferred column types, from CSV data.
Runs in your browserCSV → SQL
Loading tool…
Example
id,name 1,O'Brien 2,
INSERT INTO my_table (id, name) VALUES (1, 'O''Brien'); INSERT INTO my_table (id, name) VALUES (2, NULL);
How to use the CSV to SQL Converter
- Paste or type your CSV into the input area, or open a file from your device.
- Adjust the options above the editor if the tool offers any.
- Review the SQL result, then copy it or download it as a file.
Privacy and limitations
- Your data is processed on your device and is not uploaded to any server.
- Empty cells become NULL.
Frequently asked questions
How are column types chosen for CREATE TABLE?
Each column gets the narrowest type that fits every non-empty value: BOOLEAN, INTEGER, BIGINT, NUMERIC, VARCHAR(n) up to 255 characters, otherwise TEXT. Review them before running the script.
Related converters
JSON to SQL ConverterGenerate SQL INSERT statements from a JSON array of objects, with proper quoting and NULLs.SQL to CSV ConverterExtract rows from SQL INSERT statements into CSV, ready for Excel or another database import.CSV TransposeSwap rows and columns of CSV data, turning the header row into the first column.TSV to JSON ConverterConvert tab-separated values into a JSON array of objects keyed by the header row.CSV Column ExtractorExtract and reorder chosen CSV columns by header name or position, e.g. "email, name" or "1, 3-4".TSV to CSV ConverterConvert tab-separated values (e.g. copied from Excel or Google Sheets) into properly quoted CSV.CSV to Excel (XLSX) ConverterConvert CSV or TSV data into an Excel .xlsx workbook with delimiter auto-detection and real number and boolean cells.CSV to TSV ConverterConvert comma- or semicolon-separated values to tab-separated values that paste cleanly into spreadsheets.