CSV to SQL — CREATE TABLE + INSERTs
CSV in, .sql out. Headers become column names, types are inferred from the data (INTEGER, REAL, TEXT), each row gets its own INSERT. Runs in MySQL, Postgres, and SQLite as-is.
Drop your CSV file here
or click to browse
Generates CREATE TABLE + INSERT statements.
How it works
- 1Drop your CSV file above. It stays in your browser — nothing is uploaded.
- 2CSV First Aid parses the file and generates a CREATE TABLE statement with column types inferred from data.
- 3Download the .sql file or copy the SQL to your clipboard.
FAQ
What SQL dialect does it use?
Standard SQL compatible with MySQL, PostgreSQL, and SQLite. Column types are inferred as TEXT, INTEGER, or REAL based on data patterns.
Does it escape special characters?
Yes. Single quotes in values are escaped as double quotes ('') per SQL standard.
Related tools
CSV to JSON
CSV in, JSON array out. Headers become the object keys. Works with any delimiter the file uses — comma, semicolon, tab, pipe.
CSV to Excel (XLSX)
CSV in, .xlsx out. Encoding is detected from the bytes, special characters survive the round-trip, column widths auto-fit. Opens the same in Excel, Google Sheets, and Numbers.
CSV Viewer
A CSV rendered as a real table — zebra rows, a search box, page through 200K rows without ever opening Excel. Encoding and delimiter are figured out from the bytes.