Générateur CSV vers SQL INSERT
The fastest way to load a CSV into a database is a single INSERT statement with many VALUES tuples. Paste your CSV, set the table name, and get executable SQL immediately: the first row becomes the column list, empty cells become NULL, single quotes are doubled per the SQL standard, and quoted comma fields are split correctly.
The conversion runs entirely in your browser and your CSV is never sent to a server — for export files with sensitive data, that matters more than "online" itself.
Features
- First row is the header — The CSV header row is detected automatically and becomes the column list — no separate column input needed.
- Standard SQL escaping — Single quotes are doubled (O'Neil → 'O''Neil'), empty values become NULL, numbers stay unquoted and strings are quoted.
- Quoted field support — Parsing follows RFC 4180: "a,b" stays one field, and embedded commas and escaped quotes ("") are handled.
- Custom table name — Set the table name; identifiers are wrapped in backticks (MySQL style) so reserved words do not break the statement.
- Bulk multi-row output — All data rows become multiple VALUES tuples in one INSERT statement — efficient to execute.
- Fully local — No backend API; the CSV never leaves the browser. Copy the SQL or download it as a .sql file.
How to use
- Paste CSV content into the left panel — the first line must be the header (column names).
- Fill in the table name (defaults to my_table).
- Click "Generate" — the INSERT statement appears on the right.
- Click "Copy" or "Download", and check column names and table structure before executing.
FAQ
Is my CSV data uploaded?
No. Parsing and generation are done by JavaScript in the page; there is no code that sends your CSV anywhere, and the page works offline (the first load needs the network for page resources).
Which database dialect is the output?
MySQL / MariaDB style: backticked identifiers, single-quoted strings, doubled quote escaping. PostgreSQL and SQLite mostly accept it too; for SQL Server change the backticks to square brackets — NULL and escaping rules are the same.
What if the first row is not a header?
The first row is always treated as the header for now. If your data has none, add a column-name line (e.g. c1,c2,c3) at the top before generating, then rename the columns to the real ones before executing.
Do commas and newlines inside fields break it?
No. Parsing follows the quoting rules: a field like "a,b" stays intact, and embedded commas and escaped quotes ("") are handled correctly.
Can I execute the output directly?
The statement is a standard INSERT, but confirm the table exists, the column names and data types match, and the row count fits your transaction budget — this tool only generates SQL and makes no assumptions about your schema.