Sign up free

Excel to SQL Converter

Generate a CREATE TABLE and batched INSERT statements from a spreadsheet, for the database you use.

or drop files here

Accepts XLSX, XLS, CSV

Encrypted upload. Files are deleted automatically after 1 hour.

About Excel to SQL

Excel to SQL saves you from hand-writing INSERT statements when a spreadsheet needs to go into a database: a price list for a shop, test data, a lookup table from the finance team. Upload an XLSX, XLS or CSV file, pick MySQL, PostgreSQL, SQLite, SQL Server or Oracle, and you get a script you can run as is. For data that comes as JSON, JSON to SQL writes the INSERT statements in your browser.

The header row becomes the column names, with spaces turned into underscores and each name quoted the way your database expects. With Include CREATE TABLE on, column types are chosen from the data: integers, decimals, DATE, DATETIME, BOOLEAN or text sized to the longest value. Rows go in batches of 100 per INSERT by default, text is escaped properly, and empty cells become NULL.

How to use Excel to SQL

  1. 1
    Upload the spreadsheet

    Choose or drop an .xlsx, .xls or .csv file with column names in the first row.

  2. 2
    Choose database and table

    Pick your Database, type a Table name and decide on Include CREATE TABLE. Rows per INSERT is under More options.

  3. 3
    Click Excel to SQL

    The script is generated on our server, and every sheet gets its own table.

  4. 4
    Copy or download

    Copy the script from the result box or download the .sql file.

Why use Cubfile for this

  • Five SQL dialects

    Backticks for MySQL, brackets for SQL Server, double quotes elsewhere, plus INSERT ALL for Oracle.

  • Column types from your data

    Whole numbers, decimals, dates, true/false and text each get a fitting type.

  • Safe values

    Quotes are doubled, backslashes are escaped for MySQL and non-ASCII text gets the N prefix in SQL Server.

  • Batched inserts

    Choose how many rows go into each INSERT, up to 1,000, to suit your database's limits.

FAQ

Excel to SQL: questions and answers

How does Excel to SQL choose column types?
It looks at every value in a column. Whole numbers get INT or BIGINT, decimals a floating or numeric type, dates DATE or DATETIME, true/false BOOLEAN or BIT, and text VARCHAR(255), VARCHAR(1000) or TEXT by length, each named the way your database spells it.
Why are all my CSV columns VARCHAR?
A CSV file has no cell types, so every value is treated as text. Convert it with CSV to Excel first, which turns numbers into numbers, then run the .xlsx through this tool.
Can Excel to SQL handle a workbook with several sheets?
Yes. Each non-empty sheet becomes its own table, named after your Table name plus the sheet name, like my_table_Orders. All statements come in one .sql file.
What are the limits for free users?
2 tasks a day on a free account and 2 in total without one, for files up to 50 MB. VIP removes the task limit and raises the file size to 1 GB.
Is my data kept after I download the SQL?
No. The spreadsheet and the script are deleted automatically one hour after processing, and uploads are encrypted. We never read or reuse your data.
Share Excel to SQL with a friendIt runs in any browser, and they can try it without signing up.

Related tools

XMLXLS XML to ExcelTurn repeating XML records into spreadsheet rows.
CSVXLS CSV to ExcelOpen CSV and TSV data in Excel with the right columns and encoding.
CSVJSON CSV to JSONConvert CSV to JSON in your browser. Nothing is uploaded.
CSVXML CSV to XMLConvert CSV or Excel rows into XML records.
XLSCSV Excel to CSVSave each sheet as CSV, line breaks in cells handled.
XLSHTML Excel to HTMLTurn a sheet into an HTML table you can paste into a page.
XLSJPG Excel to ImageSnapshot sheets and charts as images.
XLSJSON Excel to JSONTurn rows into JSON objects using the header row as keys.