Destination Dazzle
Developer Tool

Excel / CSV to MySQL Converter

Upload a CSV or XLSX file (or paste CSV text) and get ready-to-paste MySQL CREATE TABLE and INSERT statements. Column types are inferred automatically. Everything runs in your browser.

📢 Advertisement

Input

📢 Advertisement

Why Convert Spreadsheets to MySQL?

Spreadsheets are the universal data format for non-technical users, but they don't scale: no concurrent access, no real querying, no relationships, no transaction safety. Moving spreadsheet data into MySQL unlocks SQL queries, joins with other tables, indexing for fast lookups, and integration with web applications. The standard workflow is: start in Excel/Google Sheets, export to CSV, then import into MySQL — and this tool is the middle step.

How Type Inference Works

The tool scans all values in each column and picks the widest MySQL type that fits: INT for whole numbers, DECIMAL for decimals, BOOLEAN for 0/1 or true/false, DATE for date-only values, DATETIME for date+time, and VARCHAR (with appropriate length) or TEXT for everything else. The inference uses the entire column, not just the first row, so the type is set to fit the largest value found. You can override any type by editing the output SQL before running it.

Batch Inserts for Performance

Each INSERT statement can contain multiple rows, which dramatically speeds up imports. A 10,000-row file becomes 100 INSERT statements at batch size 100, instead of 10,000 individual statements. MySQL parses and executes batch inserts much faster. The default batch size of 100 is a good balance between file size and performance — increase to 500 or 1000 for very large files on a fast local connection.

Safe Re-runs

The generated CREATE TABLE uses IF NOT EXISTS, so you can re-run the script without errors if the table already exists. To force a re-import, drop the table first with DROP TABLE my_table; or use a different table name. The INSERT statements are written to handle all common data types: numbers, strings, dates, NULLs, and properly escaped quotes.

Frequently Asked Questions

What file formats are supported?

The tool accepts CSV files (any delimiter: comma, semicolon, tab, pipe) and Excel files in XLSX and XLS format. SheetJS is used to parse XLSX in the browser. For CSV, the tool includes a custom parser that handles quoted fields, escaped quotes, and newlines within fields. You can also paste CSV text directly.

How are column types determined?

The tool scans all values in each column and infers the MySQL type: INT for whole numbers, DECIMAL for decimals, BOOLEAN for 0/1 or true/false, DATE for dates, DATETIME for date+time, and VARCHAR (with appropriate length) or TEXT for strings. The inference uses the maximum values found, not just the first row.

Is my data safe?

Yes. All file parsing and SQL generation happens entirely in your browser using JavaScript. Files are never uploaded to any server, never logged, and never stored. Open your browser's network tab to verify — no requests leave your device.

Can I customize the generated SQL?

Yes. The table name is configurable, the batch size (rows per INSERT) is adjustable (1-1000), and you can choose whether to add an auto-incrementing primary key. The CREATE TABLE includes IF NOT EXISTS for safe re-runs. The output is editable before you copy or download.

What's the maximum file size?

The tool handles files up to ~50 MB smoothly in modern browsers. For very large files (100+ MB), the conversion may take a few seconds. The constraint is your device's available memory. For multi-GB datasets, split the file or use a command-line tool like mysqlimport.

More Tools

📢 Advertisement