CSV to SQL
Paste a CSV and get CREATE TABLE plus INSERT statements for PostgreSQL, MySQL, or SQLite. Column types are inferred, quoted commas survive, and empty cells become NULL. Runs in your browser.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
SQL statements will appear here..
Why Use Our CSV to SQL Converter?
CSV is how data leaves almost every system: an export button, a report download, a share from a colleague. SQL is how it gets into a database. The gap between the two is usually crossed by hand, one INSERT at a time, and that is exactly the kind of repetitive work worth removing.
This converter reads the CSV entirely in your browser. It splits the header row into a column list, samples the first fifty data rows to infer whether each column is an integer, a decimal, a boolean, or text, and then writes a CREATE TABLE followed by the INSERT statements. Quoting follows the dialect you choose, so the output runs without editing whether you paste it into PostgreSQL, MySQL, or SQLite.
Nothing is executed. The tool produces SQL text and hands it to you; connecting to a database and running it stays your decision, on your machine, with your credentials.
How it compares
Most online CSV to SQL sites upload the file to a server to do the parsing. For a public dataset that is fine. For an export of customer emails, a payroll sheet, or anything under an NDA, it means handing the file to a third party for a job a browser can do on its own. This converter never makes that request.
CSV to SQL Tips
- Types are inferred from the first 50 data rows. A column that mixes 1 and 2.5 becomes numeric; a column with one non-numeric value becomes text.
- An empty cell never narrows a type. A column of integers with a gap is still an integer column.
- Identifiers are quoted for the dialect you pick: backticks for MySQL, double quotes for PostgreSQL and SQLite.
- A value containing a single quote is escaped by doubling it, which is portable across all three databases.
- SQLite has no boolean literal, so true and false are written as 1 and 0 for that dialect only.