CSV to SQL

Turn CSV rows into CREATE TABLE and INSERT statements.

CSV to SQL

.csv

Paste text or open a file to see the result.

What it does

Writes SQL statements that create a table and insert your CSV rows into it. Handy for loading a spreadsheet export into MySQL, PostgreSQL or SQLite. You get a script you can run in your database.

About the .csv format

.CSV file extension
File Type
Comma Separated Values File
Category
Data Files
MIME
text/comma-separated-values

A CSV file is a file that is saved in a comma-separated values format. Data in the CSV file is saved as separate columns of data - one per line. It can have multiple rows of data, but each row should have one value per column.

Also works with

CSV to SQL questions

How do I use the CSV to SQL?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .csv change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .csv page lists programs and converters for it.