Excel to SQL

Generate a CREATE TABLE and INSERT statements from any Excel or CSV file, with column types worked out from your data.

  • MySQL · PostgreSQL
  • SQLite · SQL Server
  • Types inferred
  • Nothing uploaded
No upload. No sign-up. No set size limit.
Paste data instead

Your files are processed on your own device. Nothing is uploaded, stored or seen by us.

How it works

How to convert Excel to SQL

  1. Add your file

    Drop an Excel or CSV file with a header row.

  2. Choose your database

    Quoting, types and batch sizes follow MySQL, PostgreSQL, SQLite or SQL Server rules.

  3. Run it

    Copy or download the .sql file and run it in your database tool.

Why this converter

SQL you can run straight away

Types from your data

INT, BIGINT, DECIMAL, DATE, DATETIME, BOOLEAN or VARCHAR sized to the longest value.

Safe quoting

Quotes inside text are escaped and names are quoted, so O'Brien won't break the import.

Batched inserts

Rows are grouped 500 (1,000 for SQL Server) per INSERT for fast loading.

NULLs

Empty cells become NULL, not empty text.

Leading zeros kept

Codes like 00123 stay text columns.

Private

Nothing is uploaded.

More data tools: Compare two files · VLOOKUP / join · Large CSV viewer · CSV editor · CSV workflow · VCF to CSV · CSV to VCF · Split CSV · Merge CSV · Remove duplicates · Clean CSV · Transpose · Excel to JSON · CSV to Markdown · HTML table to CSV

Converters: JSON to CSV · CSV to JSON · JSON to Excel · TXT to CSV · XML to CSV · XLSX to CSV · CSV to Excel

FAQ

Questions

How do I convert Excel to SQL INSERT statements?

Drop the file on the tool above, pick your database and copy the SQL, or download it as a .sql file.

How are column types chosen?

Each column is checked: whole numbers become INT or BIGINT, decimals DECIMAL (REAL in SQLite), ISO dates DATE, true/false BOOLEAN or BIT, everything else VARCHAR sized to the longest value. Edit the CREATE TABLE if you need something else.

How do I import a CSV into MySQL without SQL?

MySQL can load a CSV directly with LOAD DATA INFILE, and PostgreSQL with COPY. INSERT statements are easier when you can't access the server's files, or for small and medium tables.

Is there a row limit?

No. Large files produce large .sql files; for millions of rows, a bulk loader like LOAD DATA or COPY is faster to run.

Are my files uploaded?

No. Everything runs in your browser, so your data never leaves your computer. It works offline once the page has loaded.