Skip to content
AZ Tools

CSV → SQL INSERT Generator

Convert CSV / TSV rows into SQL INSERT statements with table name, dialect quoting, type inference, and multi-row mode.

SQL
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

  1. Paste CSV / TSV / pipe / semicolon data.
  2. Set the table name and SQL dialect.
  3. Toggle multi-row INSERT and type inference as needed.
  4. Copy the SQL into your migration / seed file.

About this tool

Show

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