Code tool

CSV to SQL INSERT

Turn CSV rows into a table definition and grouped INSERT statements in your browser. Choose a SQL dialect, infer simple column types, and keep your data local.

In-browser processingNo account requiredPrivacy details ↗
No file selected

UTF-8 comma-separated data. Quoted fields may contain commas, quotes, and line breaks. Up to 10 MB, 100,000 records, and 500 columns.

Use dots to separate schema and table, such as public.orders.

Paste CSV or choose a file, then generate SQL locally.

A QUICK WALKTHROUGH

How to use this tool

  1. Choose a CSV file or paste comma-separated text. Set the table name and SQL dialect.
  2. Choose whether the first row has column names, type inference, empty-cell handling, and rows per INSERT.
  3. Generate, review, copy, or download the SQL script.

Three SQL dialects

Choose PostgreSQL, MySQL, or SQLite. Identifiers are quoted for the selected dialect. MySQL text values use UTF-8 hex expressions, PostgreSQL uses escaped E-string literals, and SQLite uses doubled single quotes.

Explicit CSV and type rules

Quoted commas, escaped double quotes, and line breaks inside quoted fields are supported. Optional inference recognizes integers, decimals, booleans, and null; other values use text columns. Turn inference off to keep all columns as text. Empty cells in inferred numeric or boolean columns become NULL so the generated SQL stays valid; empty text cells stay empty strings unless you choose NULL handling.

Local, bounded output

Files are processed in your browser and are not uploaded. Input is limited to 10 MB, 100,000 records, and 500 columns. A configurable batch size groups data rows into multi-row INSERT statements. Generated SQL is a starting script; check it against your database schema and SQL mode before executing.

GOOD TO KNOW

Common questions

Does this run the SQL against a database?

No. It only generates a .sql script. Review and execute it yourself using your database tools.

How are table and column names protected?

Identifiers are quoted according to the selected dialect. A dotted table name is treated as separate schema and table parts, and each part is quoted.

Are CSV strings safe in the generated SQL?

Values are escaped for the selected dialect. MySQL strings are emitted as UTF-8 hex expressions; PostgreSQL and SQLite use their respective string literal forms.

Is my CSV uploaded?

No. File reading, parsing, type inference, and SQL generation happen locally in your browser.