DuckyTools
Home Convert CSV to SQL Insert

CSV to SQL Insert Convert

Generate INSERT statements from CSV data, ready to paste into a client.

CSV to SQL Insert is a free online tool that generate INSERT statements from CSV data, ready to paste into a client. It runs entirely in your web browser using plain JavaScript, so files are processed on your own device and never uploaded to a server. There is no sign-up, no file size limit imposed by the site, no watermark and no paid tier.

Price
Free — no account, no quota, no watermark
Category
Convert
Where it runs
In your browser, on your device
Files uploaded
None
Technology
plain JavaScript
Settings
2
Works offline
Yes, after the first visit

About CSV to SQL Insert

CSV rows become `INSERT` statements with the header row supplying column names. String values are quoted with embedded single quotes doubled, which is the SQL standard escape and what every major engine accepts. Empty cells become `NULL` rather than empty strings by default — a distinction that matters, because `NULL` and `''` behave differently in comparisons and aggregates.

How to use it

  1. Paste the text you want to run through csv to sql insert.
  2. Set table name and one statement per row.

The 2 settings

SettingWhat it doesDefault
Table nameFree text.my_table
One statement per rowOn or off. On by default.On

Under the hood

Runs onplain JavaScript — runs the whole thing
ControlsTable name, One statement per row

Questions

Is the output safe against SQL injection?

Quotes are escaped correctly, so ordinary data is safe. For untrusted input in an application, use parameterised queries rather than building SQL from strings at all — this tool is for one-off loads from data you control.

Can it produce a single multi-row INSERT?

Yes, and it is much faster for large files — one statement with many value tuples rather than thousands of separate statements. There is an option for it.