CSV Tools

Convert CSV to SQL

Generate SQL INSERT statements from CSV data

CSV Input

Try a sample:

SQL

SQL output will appear here...

Options

CSV Format

SQL Table

SQL Output

How to Use This Tool

This tool generates SQL statements from CSV data directly in your browser. No data is uploaded or sent to any server.

You can provide CSV input in three ways: paste it directly, upload a file, or fetch it from a URL. The SQL output updates in real time as you make changes.

  1. Provide your CSV — Paste CSV text into the input area, drop a CSV file onto the File tab, or enter a URL on the URL tab to fetch remote data.
  2. Configure options — Open the Options panel to adjust CSV parsing settings, choose your database type, set the table name, and toggle CREATE TABLE, DROP TABLE, and batch insert modes.
  3. Get your SQL — Copy the SQL output to your clipboard or save it as a .sql file using the buttons above the output preview.

FAQ

5 questions
Does this CSV to SQL converter upload my data?
No. All conversion happens entirely in your browser using JavaScript. Your CSV data never leaves your device — no server receives, stores, or processes it.
Which databases are supported?
You can generate SQL for SQLite, MySQL, and PostgreSQL. The tool adjusts identifier quoting, type names, and boolean literals to match each database's syntax.
How are column types detected?
The tool scans all values in each column. If every non-empty value is an integer, it uses INTEGER. If all values have decimal points, it uses REAL/DOUBLE/NUMERIC. If all values are true/false, it uses BOOLEAN. Otherwise it defaults to TEXT or VARCHAR.
What happens with empty cells?
Empty CSV cells are output as NULL in the generated SQL. They are also skipped during type detection, so a column with some empty cells and some integers will still be detected as INTEGER.
What is the difference between batch and per-row inserts?
Batch insert generates a single INSERT statement with all rows in one VALUES clause. Per-row insert generates a separate INSERT statement for each row. Batch mode produces more compact output.

More Convert File Formats Tools

21 tools

More CSV Tools

89 tools