Excel to SQL Insert Generator
Convert Excel or CSV rows into ready-to-run SQL INSERT statements for free.
This tool runs entirely in your browser. Your files are never uploaded to a server.
Drop an Excel or CSV file here or click to upload
What this tool does
Reads the first sheet of an uploaded spreadsheet and turns every row into a SQL `INSERT` statement, using your column headers as the column names.
How to use it
Drop or select an .xlsx, .xls, or .csv file. Once parsed, edit the suggested table name if needed — the generated statements appear immediately below, ready to copy.
Worked example
Two rows with columns `name`, `quantity`, `in_stock` — ("O'Brien Supplies", 12, true) and ("Acme Co", 5, false) — become: `INSERT INTO \`inventory\` (\`name\`, \`quantity\`, \`in_stock\`) VALUES ('O''Brien Supplies', 12, 1);` and a second line for the Acme Co row with `0` for false — notice the apostrophe in "O'Brien" is escaped by doubling it.
How values are typed and escaped
Text values are wrapped in single quotes with any internal single quote doubled; numbers are written unquoted; booleans become the integers `1` or `0`; and empty, null, or undefined cells become the SQL keyword `NULL`. Column names are wrapped in backticks, MySQL/MariaDB style.
How the table name is chosen
The table name defaults to the uploaded file's name, stripped of its extension and with any character that isn't a letter, digit, or underscore replaced — you can edit it before copying the statements.
Limitations
Only the first sheet of the file is read; other sheets in a multi-sheet workbook are ignored. There's a 5,000-row cap per upload, and backtick-quoted identifiers are MySQL/MariaDB syntax — Postgres and other databases that expect double-quoted identifiers will need the backticks replaced before running the statements. No column types, constraints, or foreign keys are inferred — this only generates INSERTs, not table-creation DDL.
Privacy
The spreadsheet is parsed entirely in your browser — the file and the generated SQL never leave your device.
Frequently Asked Questions
- Is my spreadsheet uploaded to a server?
- No, the file is parsed entirely in your browser using the xlsx library, and neither the file nor the generated SQL ever leaves your device.
- Which file formats are supported?
- .xlsx, .xls and .csv are supported, and only the first sheet's data is read — other sheets in the same workbook are ignored.
- How are text values with an apostrophe handled?
- Any single quote inside a text value is doubled (turned into '') so the generated INSERT statement stays valid SQL, matching standard SQL string-escaping.
- Is there a row limit?
- Yes, files with more than 5,000 rows on the first sheet are rejected with a message asking you to split the file into smaller pieces.
Related Tools
JSON Formatter
Format, validate and beautify JSON for free.
Regex Tester
Test JavaScript regular expressions against text for free, with live highlighting.
PDF to Excel Converter
Extract a PDF's text into rows and columns of an Excel (.xlsx) file, directly in your browser.
SQL Formatter
Format and indent SQL code into a clean, readable structure directly in your browser.
ASCII to Text Converter
Convert text to decimal 7-bit ASCII codes and those codes back to text.
ASTM Message Parser
Inspect ASTM-style laboratory messages as records, fields, control characters, and frames.