CSV to SQL Converter
Turn a CSV export into ready-to-run SQL INSERT statements without the data ever touching a server — the conversion is free and happens entirely in your browser. Set your table name, pick MySQL or ANSI quoting, and download the script.
Drop your files here - No upload required
or click to browse
CSV
CSV is the simplest and most universal tabular data format: one row per line, with values separated by commas, semicolons, or tabs. Every spreadsheet tool, database, and programming language can read and write it.
SQL
SQL INSERT scripts let you load tabular data straight into a relational database such as MySQL or PostgreSQL. Each row becomes part of a batched INSERT statement that you can run in any database client.
How the CSV to SQL conversion works
After auto-detecting your delimiter, the header row becomes the column list, quoted per dialect: backticks for MySQL, double quotes for ANSI databases such as PostgreSQL. Values are escaped safely — single quotes are doubled, so O'Brien becomes 'O''Brien', and backslashes are escaped for MySQL — while empty cells become NULL and numbers stay unquoted.
Rows are grouped into multi-row INSERT statements of up to 500 rows each, which executes dramatically faster than one INSERT per row. The table name defaults to my_table and anything you type is escaped correctly, even names containing quote characters.
Frequently asked questions
- Is a value like O'Brien handled safely?
- Yes — embedded single quotes are doubled per the SQL standard ('O''Brien'), and for the MySQL dialect backslashes are escaped too, so the script runs without syntax errors or mangled data.
- Which databases does the output work with?
- Choose MySQL for MySQL/MariaDB (backtick identifiers), or ANSI for PostgreSQL, SQLite, SQL Server, and most other databases (double-quoted identifiers). The value syntax is standard in both modes.
- Why are the INSERTs batched at 500 rows?
- Multi-row INSERTs reduce round-trips and parsing overhead, but many servers cap statement size. 500 rows per statement is a safe, fast default across common configurations.
- Does the script create the table for me?
- No — the output contains INSERT statements only. Create the table first with columns matching your CSV headers, then run the script in any database client.