---
title: "Convert Excel to MySQL"
description: "Convert Excel files to SQL for MySQL in your browser: a CREATE TABLE with typed columns, then INSERT statements. Free, and your file is never uploaded."
canonical: https://intosql.com/excel-to-mysql
last_updated: 2026-10-15
---

# Convert Excel to MySQL

Drop your Excel file to get a MySQL script with CREATE TABLE and INSERT statements. Each column gets a type, and every fix is listed with its row and column.

## From Excel to MySQL, column by column

The sample above, clientes_2024.xlsx, as IntoSQL writes it for MySQL: what each column holds in the file, the type it gets and how its first value lands in the script.

| In the file | First value | Column | MySQL type | In the script |
| --- | --- | --- | --- | --- |
| Nº Cliente | `00127` | `no_cliente` | `varchar(8)` | `'00127'` |
| Nombre | `Peña Muñoz` | `nombre` | `varchar(16)` | `'Peña Muñoz'` |
| C.P. | `01234` | `c_p` | `varchar(8)` | `'01234'` |
| Alta | `03/02/2024` | `alta` | `date` | `'2024-02-03'` |
| Activo | `sí` | `activo` | `tinyint(1)` | `TRUE` |
| Saldo | `1.234,50` | `saldo` | `decimal(6,2)` | `1234.50` |

## Load the script into MySQL

The download is a plain .sql file. Run it with MySQL's own tools.

### MySQL

```shell
mysql --default-character-set=utf8mb4 mydb < clientes_2024.mysql.sql
```

The script sets utf8mb4 itself; the flag makes the client send it the same way, so accents arrive intact. In MySQL Workbench, choose File, Run SQL Script, and pick the file.

Without a script:

```shell
intosql load clientes_2024.xlsx --into mysql://user@localhost/mydb
```

## What IntoSQL reads in Excel files

- The header row is found even when titles or notes sit above it, and a totals row at the end is left out.
- Dates stored as Excel serial numbers become real dates, in both the 1900 and the 1904 date systems.
- Codes with leading zeros, like 00127, stay text. When a workbook has several sheets, you pick the sheet.

## What to know about MySQL

- Yes and no values become tinyint(1). Text up to 255 characters is varchar; longer text is text, mediumtext or longtext by size.
- The script uses utf8mb4 and sets the SQL mode, so accents, emoji, backslashes and line breaks load as written.
- MySQL's datetime stores no time zone.

### How each kind of value is stored in MySQL

| Value | MySQL |
| --- | --- |
| Yes and no | `tinyint(1)` |
| Whole numbers | `int` |
| Large whole numbers | `bigint` |
| Decimals | `decimal(p,s) · double` |
| Floating-point numbers | `double` |
| Dates | `date` |
| Times of day | `time(6) · time` |
| Dates with a time | `datetime(6) · datetime` |
| Dates with a time and offset | `datetime(6) · datetime` |
| Text | `varchar(n) · text · mediumtext · longtext` |

## Questions about Excel to MySQL

### How do I convert Excel to MySQL?

Drop your file on the converter at the top of this page. It finds the header, reads every value and writes the MySQL script, listing each fix it made. Download the script and run it with the mysql client.

### Which sheet of the workbook is converted?

The first visible sheet. When a workbook has more than one, a Sheet option appears, so you can pick another.

### Which MySQL types does it use?

Yes and no values become tinyint(1), whole numbers int, decimals decimal(p,s), dates date, dates with a time datetime(6) and text varchar(n). Sizes come from the longest value in each column.

### Does it keep leading zeros in MySQL?

Yes. A code such as 00127 stays text, so MySQL stores it as varchar(8) and the script writes it as '00127'.

### Can it load the data into MySQL without a script?

Yes, with IntoSQL Pro. The desktop app and the command line connect to MySQL and load the rows straight in, creating the table first.

### How big can the Excel file be?

In the browser, a workbook is read whole, so the limit is the memory the browser gives this page. The desktop app and the command line take workbooks of any size; on an Apple M4 laptop the command line converts a 117 MB workbook of a million rows in about a second.

## Excel into other databases

- [Convert Excel to SQL](https://intosql.com/excel-to-sql)
- [Convert Excel to PostgreSQL](https://intosql.com/excel-to-postgresql)
- [Convert Excel to MariaDB](https://intosql.com/excel-to-mariadb)
- [Convert Excel to SQLite](https://intosql.com/excel-to-sqlite)
- [Convert Excel to SQL Server](https://intosql.com/excel-to-sql-server)
- [Convert Excel to Oracle](https://intosql.com/excel-to-oracle)

## Other files into MySQL

- [Convert CSV to MySQL](https://intosql.com/csv-to-mysql)
- [Convert JSON to MySQL](https://intosql.com/json-to-mysql)
