CSV → SQL INSERT Generator
Convert CSV / TSV rows into SQL INSERT statements with table name, dialect quoting, type inference, and multi-row mode.
INSERT INTO "users" ("id", "name", "role", "joined", "score", "active") VALUES (1, 'Alice', 'Engineer', '2024-01-15', 87.5, TRUE);
INSERT INTO "users" ("id", "name", "role", "joined", "score", "active") VALUES (2, 'Bob', 'Designer', '2023-08-22', 92.0, TRUE);
INSERT INTO "users" ("id", "name", "role", "joined", "score", "active") VALUES (3, 'Carol', 'PM', '2025-03-04', 79.3, FALSE);How to use
- Paste CSV / TSV / pipe / semicolon data.
- Set the table name and SQL dialect.
- Toggle multi-row INSERT and type inference as needed.
- Copy the SQL into your migration / seed file.
About this tool
ShowHide
Turn a CSV export into INSERT statements you can run: pick the target table, the SQL dialect and whether to emit one multi-row statement or one statement per row. Identifier quoting follows the dialect you choose — backticks, double quotes or square brackets — which is exactly why a script generated for one database throws a syntax error on another. String values are escaped by doubling single quotes, so an apostrophe in a surname is safe rather than an accidental end of literal. An empty cell or the literal word null becomes SQL NULL rather than an empty string, and with type inference on, integers, decimals and true and false are written unquoted so they land in numeric and boolean columns as values instead of text.
Frequently asked questions
What's multi-row INSERT?
Instead of one INSERT statement per row, multi-row produces a single INSERT with all VALUES tuples. It's much faster for bulk loads but harder to read.
How does type inference work?
Integers (123), decimals (1.5), TRUE/FALSE, and NULL go in unquoted. Everything else is treated as a string and wrapped in single quotes with proper escaping. A number with a leading zero, such as a ZIP code 02134 or a phone number, stays a quoted string so the zero is not lost.
Will it inject SQL?
Quotes inside strings are doubled ('it''s safe'), which is the standard SQL escape. Don't rely on this for untrusted data — use parameterized queries in production code; this tool is for seed data and migrations. For MySQL, backslashes are doubled as well, because its default mode treats \ as an escape character inside strings.
Why is identifier quoting different per dialect?
MySQL uses backticks (col), PostgreSQL and SQLite use double quotes ("col"), and Standard SQL (SQL-92) also uses double quotes. The tool picks the right one so the output runs on your target DB.
Guides on this topic
Related tools
JSON → SQL INSERT
Turn a JSON array of objects into INSERT statements — PostgreSQL, MySQL, SQLite, or ANSI quoting, with an optional ON CONFLICT upsert tail.
Convert
Mock Data Generator
Generate realistic fake records for testing — names, emails, dates, IDs, lorem — exported as JSON, CSV, or SQL INSERTs.
Developer
HTML Table to CSV Converter
Extract HTML <table> data into CSV, TSV or semicolon-separated rows, in your browser.
Convert
CSV ↔ TSV ↔ Pipe Converter
Switch delimited text between CSV, TSV, pipe, and semicolon — with proper RFC-4180-style quoting and auto-detection.
Convert
Markdown Table Generator
Paste CSV, TSV, or pipe-delimited data and get a properly aligned GitHub-flavored Markdown table.
Text
CSV to Excel (XLSX) Converter
Turn CSV or TSV into a real .xlsx file in your browser, with leading zeros, long IDs and codes like SEPT1 kept exactly as typed.
File