EN
PortuguêsEnglishEspañol
All tools
Developer tools 100% free

CSV to SQL (INSERT and CREATE TABLE)

Convert CSV or data copied from Excel into SQL INSERT statements, with CREATE TABLE and automatically detected types, for MySQL, PostgreSQL, SQLite and SQL Server.

How to use

Thank you so much for helping!

Every donation helps pay for the servers and keeps the tools free for everyone. Pick or type an amount:

Secure payment by Stripe. Opens in a new tab.

Back to Format and convert

Paste the CSV with the header in the first row.

Available in: PortuguêsEspañolEnglish

Advertisement

CSV to SQL (INSERT and CREATE TABLE): what it is for

Paste a CSV or cells copied from Excel with the header in the first row. The tool detects the separator, checks each column to choose its type (INTEGER, DECIMAL, DATE, BOOLEAN or VARCHAR), escapes quotes, turns empty cells into NULL and generates the INSERT statements, in batches of 500 rows or one per row, with the right name quoting for each database.

The data is not sent to any server: the conversion happens in your browser.

How to use

  1. Paste the CSV with its header.
  2. Choose the database, table name and options.
  3. Copy or download the SQL.

When to use it

  • Importing spreadsheets into a database.
  • Creating test data from Excel.
  • Moving lists into a new table.

Frequently asked questions

How are the column types detected?

The tool checks every value in each column: only integers becomes INTEGER, numbers with decimals become DECIMAL, dates in YYYY-MM-DD format become DATE, true/false becomes BOOLEAN and everything else becomes VARCHAR with the length of the longest value.

What about quotes and special characters?

Text is escaped by doubling single quotes, as the SQL standard requires. Empty cells become NULL.

What changes between databases?

The way names are quoted: backticks in MySQL, double quotes in PostgreSQL and SQLite, and square brackets in SQL Server.

Is it really free?

Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.

Similar tools

The tools are provided as is, without warranty. We are not responsible for the results or for how they are used.