CSV to SQL INSERT
Generate INSERT statements and a matching CREATE TABLE from a CSV, with types inferred per column.
Your result will appear here as soon as you add some input.
How to use it
- 1Paste your CSV, or open the file in a text editor and copy it in.
- 2Adjust the delimiter and header options if the preview looks wrong.
- 3Adjust the options if you need something other than the defaults.
- 4Download the result, or copy it straight back into your spreadsheet.
About the CSV to SQL INSERT
Column types are inferred from the values: integers, decimals, booleans and dates are detected, everything else becomes VARCHAR. The suggested CREATE TABLE is a starting point, not a schema - review the lengths and the keys before running it.
Rows are batched into multi-row INSERT statements, which is far faster than one statement per row on every database that supports it.
String values are escaped by doubling single quotes. That is correct SQL, but generated statements are for loading data you control: never build a query from untrusted input by concatenating strings. Use parameters.
Questions people ask
Is your data uploaded to a server?
No. This tool runs entirely in your browser using standard web APIs, so your data never leaves your device. You can confirm it by opening your browser's network panel while the tool runs, or by disconnecting from the internet after the page has loaded.
Is it free, and do I need an account?
Yes, it is free, and there is no account, no sign-up and no watermark on the result. The project is funded by optional donations.