← All text tools

CSV to SQL

Turn CSV into CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.

  • Free
  • No sign-up
  • Works on any device

About CSV to SQL

Paste CSV and get a CREATE TABLE statement plus INSERT rows for MySQL, PostgreSQL, SQLite or SQL Server. Column types are guessed from the data, and quoting differs by dialect: MySQL uses backticks, PostgreSQL double quotes. Review the guessed types before running the script on real data.

How to use CSV to SQL

  1. Paste your CSV or add a file, and check that the first row holds column names.
  2. Choose MySQL, PostgreSQL, SQLite or SQL Server and set the table name.
  3. Copy the CREATE TABLE and INSERT statements.

Why use this tool?

Also known as

Frequently asked questions

How are column types chosen from CSV?

Values are scanned: whole numbers become integers, decimals become numeric types, and everything else becomes text. Check the result, especially for IDs with leading zeros.

What if my CSV uses semicolons?

Select the matching delimiter in the options if available, or replace semicolons with commas first. Otherwise every row ends up in one column.

How are empty cells handled?

Empty values are usually written as NULL. Review the statements if your table needs a default value instead.

Is CSV to SQL free?

Yes. CSV to SQL on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put CSV to SQL on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools