In this guide
FROM ROWS TO SQL
Spreadsheet to SQL guide
Convert Excel and delimited files into SQL. Review inferred types, choose a dialect, and export your rows.
Make SQL from the rows you already have
Spreadsheet to SQL reads .xlsx, .csv, .tsv, and .txt files locally in your browser, then generates CREATE TABLE and INSERT statements for one selected worksheet.
Review inferred types and conversion issues before copying or downloading the SQL. The converter does not execute it against a database.
Import, review, then generate
- Upload a supported file. For an XLSX workbook, open Import settings and select the worksheet you want to convert.
- Open import settings. Set the SQL table name, choose a database dialect, and decide whether the first row contains column names.
- Review the column types and preview rows. Override any incorrect types, then save settings to apply them. Cancel discards pending settings edits.
- Review conversion issues, copy the SQL, or download it. Paste it into SQL to ERD to visualize the table and preview the inserted rows.
Input format & header rules
Use one record per row and one field per column. With headers enabled, the first row supplies column names; disable that setting when the first row contains data. Names are normalized into safe SQL identifiers, and duplicate column names are disambiguated.
CSV delimiter detection supports common delimited text; TSV uses tab separators. Quote CSV fields containing commas, quotes, or line breaks, and escape a quote inside a quoted field by doubling it.
The XLSX reader extracts worksheet values and date styles. Keep data tabular and review the selected worksheet preview. Legacy .xls files are not supported; save them as .xlsx or CSV first.
id,name,email
1,Ada,[email protected]
2,"Grace, Hopper",[email protected]Type inference & dialect choices
Columns can use Auto detect or a manual Text, Boolean, Integer, Numeric, Date, or Timestamp type. The chosen dialect maps these logical types to its own SQL types and literal syntax.
Auto detect preserves leading-zero numeric text and mixed-type columns as Text, with a conversion note. Choose Text for identifiers such as postal codes or account numbers. Numeric spreadsheet cells cannot recover a display format such as 00001 from a type override; store these identifiers as text in the source.
| Dialect | Identifiers | Booleans | Dates / timestamps |
|---|---|---|---|
| SQLite | "column" | INTEGER; 1 / 0 | TEXT / TEXT |
| PostgreSQL | "column" | BOOLEAN; TRUE / FALSE | DATE / TIMESTAMP |
| MySQL | `column` | TINYINT(1); 1 / 0 | DATE / DATETIME |
| SQL Server | [column] | BIT; 1 / 0 | DATE / DATETIME2 |
Values, NULL markers & spreadsheet formulas
| Input | Conversion behavior |
|---|---|
| Empty cells and missing values | Become SQL NULL. Fully empty data rows are omitted. |
| NULL-like text | Case-insensitive n/a, na, null, nil, none, #n/a, #null!, and - become SQL NULL, even with a Text override. Use a different source value if the marker is meaningful text. |
| Boolean values | True/false, yes/no, and y/n are recognized; a Boolean override can also read 1/0. Mixed columns may remain Text. |
| XLSX formulas | Reads the cached cell result; does not evaluate formulas. Recalculate and save the workbook in Excel before importing, or supply values in CSV. |
| Dates and timestamps | XLSX date styles and supported date text inform inference. Check the preview; display formats are not preserved. |
| Preview rows | The visual preview shows up to 100 rows. Generated SQL still includes all non-empty rows from the selected worksheet. |
| Worksheet/header changes | Reset per-column type overrides. Review the new column names and types before saving settings. |
CREATE TABLE + INSERT output
The generated script defines the selected worksheet’s columns and inserts its rows. Strings are escaped, blank values become SQL NULL, and literal formatting follows the chosen dialect.
Column definitions do not automatically add primary keys, foreign keys, or relationships. Add those constraints deliberately in the SQL editor if your data model requires them.
SQL Server output splits INSERT batches at 1,000 rows. Header-only input produces CREATE TABLE without INSERT; a completely empty file produces no SQL.
CREATE TABLE "contacts" (
"id" INTEGER,
"name" TEXT,
"email" TEXT
);
INSERT INTO "contacts" ("id", "name", "email") VALUES
(1, 'Ada', '[email protected]'),
(2, 'Grace, Hopper', '[email protected]');Conversion issues & file limits
An incompatible value under a selected type can become NULL in generated SQL and receives a conversion issue. Review the source value, choose an appropriate type, or correct the spreadsheet. Use the issue report to locate values needing attention.
Files are limited to 25 MB. XLSX archives are also bounded by 2,048 entries and 100 MB of uncompressed data. Convert a smaller workbook or split the source when an import exceeds these limits.
Convert worksheets individually. Browser previews and SQL generation do not create a persistent database or infer a relational schema across sheets.
Troubleshoot a spreadsheet import
| Symptom | What to check |
|---|---|
| Wrong column names or a missing first record | Review First row contains column names and the selected worksheet in Import settings. |
| An identifier lost its leading zeros | Store it as text in the workbook. Numeric display formatting is not an identifier value. |
| A value becomes NULL unexpectedly | Check conversion issues and the NULL-like markers above. Type overrides do not preserve NULL markers as text. |
| Only 100 rows appear | That is the preview limit; Copy SQL and Download include all non-empty source rows. |
| Formula output is blank or out of date | Recalculate and save the workbook so cached results are available, or export the calculated values as CSV. |
| Type overrides disappeared | Changing the worksheet or header choice resets overrides. Reapply the intended types before Save settings. |
| Copy SQL fails | Check browser clipboard permissions or use Download to obtain the generated .sql file. |
Ask AI to review data and SQL
Copy this guide as an AI prompt, then provide your target dialect, worksheet, header choice, table name, and type overrides. Include a small representative sample and the conversion issues you need help with.
Ask for schema constraints as a separate design decision. Review the generated SQL before running it in your own database or adding it to SQL to ERD.
Review my spreadsheet conversion for SQLite.
Worksheet: Contacts. First row is headers. Table name: contacts.
Keep account_code as Text to preserve leading zeros.
Explain any values that become NULL and suggest type corrections.
Ask before adding primary keys or relationships.