Data Tools

CSV to SQL Converter

Convert CSV rows to SQL INSERT statements. Choose your table name, database dialect, and batch size — free, browser-based, no uploads.

No uploads — browser onlyInstant result

Table name

CSV delimiter

Dialect

Rows per INSERT

CSV Input (first row = column headers)

How to convert CSV to SQL INSERT

  1. Paste your CSV data or upload a .csv file.
  2. Enter the target table name.
  3. Choose the delimiter and SQL dialect for your database.
  4. Set the batch size — how many rows per INSERT statement.
  5. Click Generate SQL INSERT, then copy or download the result.

Generate SQL INSERT statements from CSV

This tool turns CSV rows into ready-to-run SQL INSERT statements. The first row becomes the column list, each following row becomes a set of values, and you choose the target table name. Values are quoted and escaped automatically, and you can group many rows into multi-row INSERT statements with the rows-per-INSERT setting. It generates INSERT statements only — it does not create the table or its schema, so the table should already exist with matching columns.

Common uses

  • Importing spreadsheet or export data into an existing database table.
  • Building migration or seed scripts for a new environment.
  • Generating realistic test data for development and QA.
  • Moving CRM, analytics, or reporting exports into a database.

Need the same data as a spreadsheet or structured JSON instead? Try CSV to XLSX or CSV to JSON.

How values are typed

The generator auto-detects integers, floats, booleans (true/false), and empty/null values — these are output without quotes. All other values are wrapped in single quotes with single-quote characters escaped as '' (SQL standard escape). Dates are not specially detected, so they are treated as text and quoted. Column names are quoted using the dialect-appropriate quoting character.

Supported database dialects

Choose from MySQL, PostgreSQL, SQLite, and SQL Server. The dialect setting controls how table and column names are quoted — backticks for MySQL and SQLite, double quotes for PostgreSQL, and square brackets for SQL Server — while the INSERT syntax and value formatting stay the same across all four. Other databases such as Oracle are not specifically supported, though the generated INSERT statements are close to standard SQL and can often be adapted. The tool emits INSERT statements only; it does not generate CREATE TABLE, UPDATE, DELETE, or MERGE.

Privacy — processed in your browser

All conversion runs in your browser. Your CSV data is never sent to any server — making it safe for internal data and database records.

Frequently Asked Questions

What SQL statements does it generate?

It generates INSERT statements only. It does not produce CREATE TABLE, UPDATE, DELETE, or MERGE, so the target table should already exist with matching columns.

Does the first CSV row become the column names?

Yes. The first row is read as the header and used as the column list in every INSERT statement; the remaining rows become the inserted values.

Can I choose the table name?

Yes. Set the table name in the options — it is quoted for your chosen dialect and used in every generated INSERT statement.

What is the batch size setting?

Some databases perform better with multiple rows in a single INSERT VALUES statement. Setting batch size to 100 means 100 rows per INSERT statement, which is efficient for most databases. Set to 1 for one INSERT per row.

How are column names quoted?

MySQL uses backticks (`col`), PostgreSQL uses double quotes ("col"), SQL Server uses square brackets ([col]), and SQLite uses backticks. This prevents conflicts with reserved keywords.

How are quotes and apostrophes escaped?

Text values are wrapped in single quotes, and any single quote inside a value is escaped by doubling it (''), following the SQL standard. Backslashes are escaped as well.

How are empty cells and NULLs handled?

An empty cell, or a value of "null" in any case, is written as an unquoted NULL. Other values are inserted as numbers, booleans, or quoted text depending on their content.

Does it detect numbers, dates, and booleans?

Numbers (integers and decimals) and the words true/false are detected and written without quotes. Dates are not specially detected — they are treated as text and quoted — so format them to match your column type if needed.

Which database dialects are supported?

MySQL, PostgreSQL, SQLite, and SQL Server. The choice changes how identifiers are quoted; the INSERT body is otherwise the same. Oracle is not specifically supported.

Can it generate CREATE TABLE statements?

No. This tool produces INSERT statements only — it does not infer a schema or emit CREATE TABLE.

Can I use a semicolon or tab as delimiter?

Yes — use the delimiter selector to choose comma, semicolon, or tab. Tab-separated (TSV) files are also supported.

Can I download a .sql file?

Yes — copy the output to your clipboard, or download it as a .sql file named after your table.

Is my CSV uploaded?

No. Everything runs in your browser and your CSV data is never sent to a server. The practical size limit is your browser's available memory.

Related tools