Skip to content
Mediawand

CSV to SQL Converter

Load a spreadsheet export into a database without an import wizard. The column types are worked out from the data, and you get a CREATE TABLE plus INSERT statements written for your database.

How to convert CSV to SQL

  1. 1Paste CSV with a header row, or open a .csv file.
  2. 2Name the table and pick your database.
  3. 3Copy the SQL or download it as a .sql file, then run it.

Column types

Each column becomes an integer, decimal, boolean, date, date-time or text column, depending on what all its values look like. Values with leading zeros, like zip codes, stay text so nothing is lost.

Written for your database

Names are quoted the way each database expects ("name", `name` or [name]), true and false become TRUE/FALSE or 1/0, and single quotes inside text are escaped. SQL Server gets N'…' strings and at most 1,000 rows per INSERT.

Big files

Rows are grouped into multi-row INSERT statements, 100 by default, which loads much faster than one statement per row.

Frequently asked questions

Is my data uploaded?
No. The conversion runs in your browser and nothing is sent anywhere.
What happens to empty cells?
They become NULL, unless you turn that off, in which case empty text stays an empty string.
Should I check the column types?
Yes. They're guessed from the data you paste, so review them, for example to give text columns a length limit.

Related tools

Loading tools…