CSV to SQL

Generate SQL INSERT statements from CSV

Uploaded files: up to 400,000 rows (including the header row, files up to 150 MB). Pasted text: up to 65,000 rows. Conversion runs in the background — this tab stays responsive.

Click or drop a .csv file here

About CSV to SQL

CSV to SQL generates a CREATE TABLE statement and one INSERT statement per row from a CSV file (or pasted CSV text), entirely in your browser — nothing is uploaded to a server. CSV parsing is quote-aware: a field wrapped in double quotes can safely contain a comma (like 'Smith, John') without being split into extra values. Values are also escaped for SQL string literals (a quote inside a value is doubled, the standard SQL escaping). Large files are read and parsed off the main thread in a Web Worker, so the page stays responsive. Column and table names typed into the Table Name field are not escaped, so avoid spaces or SQL reserved words there.

How to use CSV to SQL

  1. 1Type your table name, or keep the default.
  2. 2Click the upload area and select a .csv file, or paste CSV text directly into the box below it.
  3. 3Click 'Convert' to generate a CREATE TABLE statement plus one INSERT per row.
  4. 4A file upload downloads automatically as converted.sql; pasted text appears in the output box for you to copy.

Frequently Asked Questions

Is CSV to SQL free to use?

Yes, it's completely free with no signup required.

Are values safely escaped in the generated SQL?

Yes — quotes inside values are doubled following standard SQL string escaping, so values containing an apostrophe (like a name such as O'Brien) produce valid, safe SQL rather than broken or exploitable statements.

What data types does the CREATE TABLE statement use?

Every column is created as VARCHAR(255), regardless of whether the CSV data looks numeric, a date, or text — edit the generated statement if you need different types.

Does it support file upload, or only pasted text?

Both — upload a .csv file, or paste CSV text directly into the box. No delimiter other than commas is supported (a comma inside a properly double-quoted field is treated as data, not a delimiter).

Why is there a row limit, and why is it lower for pasted text?

Converting a very large CSV in a browser tab risks running out of memory and crashing the tab. Uploaded files support up to 400,000 rows on desktop (65,000 on phones/tablets); pasted text is capped lower, at 65,000 rows on any device, since pasted text has to live in the page itself and be re-rendered into the input box, rather than being streamed in like a file. The count includes the header row.

Tips & Tricks

  • Values are escaped for SQL, but the table name and column headers are inserted as-is — avoid spaces, quotes, or reserved SQL keywords in the Table Name field or your CSV header row.
  • Every column defaults to VARCHAR(255); adjust the CREATE TABLE statement afterward if you need numeric, date, or other column types.
  • Wrap a value in double quotes if it contains a comma (e.g. "Smith, John") — quoted fields are parsed correctly and stay as a single value.
  • Always review generated SQL — and test it on a development database — before running it against production.