Excel to SQL

Turn rows from an Excel sheet into INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.

or drop a file here

Upload an Excel file and click Convert to see the SQL here.

How Excel to SQL works

Turns rows from an Excel sheet into SQL INSERT statements, with a CREATE TABLE statement at the top if you want one. The first row gives the column names. Choose your database: MySQL, PostgreSQL, SQLite or SQL Server.

Numbers stay numbers and TRUE/FALSE cells stay booleans. Dates are written as text in ISO format, like 2024-05-01T00:00:00.000Z. Empty cells become NULL.

Input to Excel to SQL

  • Upload or drop one .xlsx or .xls file. Click Sample to try it with a sample file.
  • When the file has more than one sheet, pick one from the Sheet list.
  • Table name is filled in from the file name, like sales_2024 for Sales 2024.xlsx. Rows per INSERT can be 1, 100, 500 or 1000.
  • Turn off "First row is the header" when the sheet has no header. Columns are then named Column 1, Column 2 and so on.
  • Files up to 20MB. Files locked with a password cannot be read. Everything runs in your browser, so your data never leaves your computer.

Output from Excel to SQL

  • SQL with syntax highlighting. Column types in CREATE TABLE are guessed from the values in each column.
  • Names and values are quoted and escaped for the database you pick.
  • Copy it, download it as a .sql file named after the table or open it in full screen. Change the sheet or an option and the SQL updates right away.