This tool converts CSV data into SQL INSERT statements — one statement per data row — ready to run in psql, the MySQL client, SQLite or SQL Server. It is a fast way to load a spreadsheet or export into a database table without writing the INSERTs by hand or setting up an import tool.
How it works
The first row of the CSV is treated as the column names, and you supply the table name. Each following row becomes an INSERT INTO table (cols) VALUES (...) statement. An RFC 4180-aware parser handles quoted fields, embedded commas and doubled quotes. With type inference on, the tool emits appropriate SQL literals:
| Cell value | SQL output |
|---|---|
| clean number (e.g. 42) | 42 (unquoted) |
| true / false | TRUE / FALSE |
| empty cell or “null” | NULL |
| anything else | 'quoted string' (single quotes doubled) |
Turn inference off to quote every value as a string.
Example
Given the CSV:
id,name,active
1,Ada,true
2,"Bao, Jr.",false
with table name users, it produces:
INSERT INTO users (id, name, active) VALUES (1, 'Ada', TRUE);
INSERT INTO users (id, name, active) VALUES (2, 'Bao, Jr.', FALSE);
Note the number stays unquoted, the booleans become TRUE/FALSE, and the comma inside “Bao, Jr.” is kept as part of the string.
Dialect differences
Different databases have slightly different INSERT syntax. This tool handles the three main dialects:
| Dialect | Quoting style | Boolean syntax | NULL |
|---|---|---|---|
| PostgreSQL | Double quotes for identifiers, single quotes for strings | TRUE / FALSE | NULL |
| MySQL | Backtick quotes for identifiers (optional), single quotes for strings | TRUE / FALSE or 1 / 0 | NULL |
| SQL Server | Square brackets for identifiers, single quotes for strings | 1 / 0 (no TRUE/FALSE keyword in older versions) | NULL |
Pick the dialect that matches your target database before copying.
Security note: SQL injection
The tool doubles any single quote inside a string value (' becomes ''), which is the standard SQL escaping rule and prevents the most basic injection from literal data. However, the generated statements are designed for loading trusted data from a spreadsheet, not for dynamically building queries from untrusted user input. When building application queries from user-supplied data, always use parameterized queries / prepared statements in your database driver rather than string concatenation.
Practical workflow
- Export a table or report to CSV from your source (Excel, Google Sheets, database, API).
- Paste it here, enter the target table name, and pick the dialect.
- Toggle type inference on (or off for all-text imports).
- Copy the generated statements and run them in your database client, or save as a
.sqlmigration file.
This is faster than writing INSERTs by hand for a one-time load, and more transparent than a GUI import wizard when you need to review exactly what SQL will run. Everything runs locally in your browser — nothing is uploaded.