Category: Developer tools

CSV to SQL INSERT

System ideaMissing a tool?

Convert CSV rows into SQL INSERT statements

Paste CSV data and a table name to generate one SQL INSERT statement per row, with numbers and NULL left bare and text values safely quoted and escaped. Runs entirely in your browser.

SQL statements
INSERT INTO "people" ("id", "name", "active") VALUES (1, 'Ada Lovelace', 'true');
INSERT INTO "people" ("id", "name", "active") VALUES (2, 'Doe, John', 'false');
INSERT INTO "people" ("id", "name", "active") VALUES (3, 'Grace Hopper', 'true');

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

Seeding a test database or migrating a spreadsheet into a table usually means turning every row into its own INSERT statement, which is tedious and easy to get wrong once a value contains a quote or an apostrophe. This tool parses your CSV the same way a spreadsheet would, including quoted fields with embedded commas, then builds one INSERT statement per data row: numeric-looking values and the literal `NULL` are written bare, everything else is single-quoted with embedded quotes doubled so the statement stays valid SQL.

How to use it

  1. Paste CSV data, or load the example.
  2. Enter the target table name and choose whether to quote identifiers.
  3. Copy the generated INSERT statements.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

Is my CSV uploaded anywhere?
No. Parsing and SQL generation happen in JavaScript running in the page, so nothing you paste ever leaves your device.
How does it decide between a quoted string and a bare value?
A cell that looks like a plain integer or decimal, or the literal word NULL, is written without quotes; everything else is wrapped in single quotes with any embedded quote doubled, the standard SQL escaping.
What does 'Quote identifiers' do?
It wraps the table name and column names in double quotes, which is useful when they contain spaces, punctuation or a reserved word; turn it off for a database that doesn't expect quoted identifiers.