toolfora
Home / Excel / Excel to SQL

Excel to SQL

Turn an Excel (.xlsx) or CSV table into ready-to-run SQL. Choose your database dialect (MySQL, PostgreSQL, SQLite, SQL Server, Oracle), set the table name and batch size, pick INSERT / REPLACE / UPDATE mode, and optionally generate the CREATE TABLE statement. Files are parsed locally with SheetJS — nothing is uploaded.

SQL Output

Generated SQL appears here.

How to use Excel to SQL

Open a local .xlsx or .csv file and convert its rows into SQL statements, processed entirely in your browser with SheetJS. The first row must hold the column names; each following row becomes a record.

Dialects

Choose MySQL, PostgreSQL, SQLite, SQL Server or Oracle. The tool adapts identifier quoting (backticks, "double quotes", [brackets]) and REPLACE/upsert syntax per dialect.

Modes

  • INSERT — standard INSERT INTO ... VALUES (...), batched into multi-row groups of your chosen size (0 or 1 = one row per statement).
  • REPLACE / upsert — MySQL REPLACE INTO, SQLite INSERT OR REPLACE INTO, PostgreSQL ON CONFLICT, SQL Server / Oracle MERGE. Needs a primary key column.
  • UPDATE — generates UPDATE ... SET ... WHERE <pk> = ... per row. Needs a primary key column.

Options

  • Batch size — rows per INSERT statement (multi-value). 0 = all rows in one statement.
  • String escaping — single quotes are doubled ('') per SQL standard; empty cells become NULL.
  • CREATE TABLE — a column list is generated from the header, with types inferred from the data (numbers → INT/DECIMAL, dates → DATE, everything else → VARCHAR/TEXT, adapted per dialect).

Copy the output or download it as a .sql file. Your data never leaves the page.