CSV to SQL Insert Converter

Turn CSV rows into SQL INSERT statements, one per row, with quoted column names and values escaped for the SQL dialect you choose. Empty fields become NULL and plain numbers are written without quotes.

1 Paste your text and pick the options

2 Your answer

Your answer shows here as you type.

How to use the CSV to SQL Insert Converter

  1. Paste CSV rows into the box. Quoted fields may contain commas.
  2. Enter the target table name and choose whether the first row holds column names.
  3. Pick the identifier quoting that matches your database, then copy the INSERT statements.

Frequently asked questions

How are empty CSV fields handled?

An empty field is written as NULL. Values that look like plain integers or decimals are written without quotes, and all other values are wrapped in single quotes with any single quote doubled.

Why are identifiers quoted?

Quoting lets column and table names contain spaces or reserved words. PostgreSQL and SQLite use double quotes, MySQL and MariaDB use backticks, and SQL Server uses square brackets.

Does this handle commas and line breaks inside fields?

Yes. A field wrapped in double quotes can contain commas and line breaks, and a doubled double quote inside it becomes a single quote character in the value.

Can I run one large INSERT instead of one per row?

This tool writes one INSERT per row, which works in every dialect. Multi-row VALUES lists are shorter but have row limits in some databases, such as 1000 rows in SQL Server.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.