Excel to SQL Converter
Runs in your browser — your files are never uploaded.
Turn a spreadsheet into a ready-to-run SQL script: a CREATE TABLE with column types inferred from the data, followed by one INSERT per row. The table is named after the sheet, text values are escaped so an apostrophe in a name cannot break the statement, and empty cells become NULL rather than empty strings. The whole workbook is read in your browser — useful, since the spreadsheets people load into databases are usually the ones with real records in them.
How to convert Excel to SQL
- 1
Drop your .xlsx or .xls file onto the box, or click to choose one.
- 2
The first sheet is read, with its header row as the column names.
- 3
Click “Download” to save your .sql file.
Share
Embed this tool on your site
Paste this where you want the tool to appear. It runs entirely in your visitor's browser — no uploads, no account, no tracking.
Please keep the attribution line — it's what keeps these tools free.
Need a different size, a dark theme, or a different tool? Build an embed lets you preview it first.
Frequently asked questions
How are column types decided?+
From the data. A column where every value is a whole number becomes INTEGER, one with decimals becomes REAL, and anything else becomes TEXT. A single non-numeric value is enough to widen a column to TEXT, which is the safe direction.
Which sheet is used?+
The first one in the workbook. Converting several sheets into one table would require them to share a schema, which is an assumption worth not making.
What if a value contains an apostrophe?+
It is escaped by doubling, per the SQL standard, so a name like O’Brien produces a valid statement instead of a syntax error partway through your import.
Is the output portable across databases?+
It is plain ANSI-style SQL with no engine-specific syntax, so it runs on SQLite, PostgreSQL and MySQL. You may want to adjust the column types by hand if you need something more precise than INTEGER, REAL or TEXT.
Are dates and currency preserved?+
They are converted as Excel displays them, since the displayed value is what the sheet actually means. Check the output before importing if a column needs a specific date format in your database.