How to convert CSV to Excel
- Drop one or more
.csvfiles into the box above, or paste CSV text into the field. Nothing is uploaded. - Press Convert to Excel. Files you drop are converted straight away.
- Read the table under the report. It shows, column by column, whether each one was stored as numbers, dates or text, and why.
- Press Download .xlsx. Several files download as one workbook with a sheet for each file.
Why not just open the CSV in Excel?
You can, and Excel will guess what every value is. The guesses happen while the file opens, before you see a single cell, and several of them destroy data in ways that saving does not undo. Microsoft documents the behaviour, and its fix is a setting that most people never find. These are the four that do the most damage.
| In the CSV | After Excel opens it | What is lost |
|---|---|---|
00721 | 721 | The leading zeros of postcodes, account and product codes |
4111111111111111 | 4.11111E+15, stored as 4111111111111110 | Every digit after the 15th |
MARCH1, 1-2 | 1-Mar, 2-Jan | The original text, replaced by a date serial |
=HYPERLINK("...") | A live formula | Safety: the cell runs instead of being shown |
The second row is the one people notice last. Excel keeps 15 significant digits, so a 16-digit card number, IMEI or order ID is rounded on the way in. The cell shows scientific notation, and changing the format to Number shows the damage: the last digit is now a zero. There is nothing left to recover it from.
The third row has its own history. Excel converted gene symbols such as MARCH1 and SEPT2 into dates so often that a 2016 survey found the errors in about a fifth of published genomics papers with gene lists in Excel files. In 2020 the human gene naming committee renamed the genes to MARCHF1 and SEPTIN2 rather than wait for a fix.
How this converter decides each column
Instead of guessing cell by cell as the file opens, it reads the whole column first.
That matters for a postcode column: if Excel's rule were applied to one cell at a time,
10001 would become a number while 02134 stayed text. The
column would then sort in two separate groups and a lookup would miss half of it.
- Numbers are stored as real numbers, so they add up, sort and chart correctly. The exception is any column where even one value has a leading zero or more than 15 digits. That whole column is stored as text.
- Dates are recognised only in the unambiguous ISO form,
2024-03-15or2024-03-15 14:30:00. They become real Excel dates with a matching format. Nothing else is read as a date, because03/04/2024means March in one country and April in the next. - Everything else is text, stored as text, and shown exactly as it was written. A text cell is never run as a formula and never converted to a date.
The report counts the cases where this made a difference: the columns kept as text and
the reason, how many values Excel would have turned into dates, and how many cells
began with =, +, - or @. Those are
the characters that start a formula when Excel opens a CSV directly. Spreadsheet
security guides call this CSV injection, because a crafted cell can run a formula on
the machine of whoever opens the file.
Semicolons and decimal commas
In much of Europe, Excel saves CSV files with semicolons between fields and commas as
decimal marks, so 12,5 means twelve and a half. The delimiter is detected
by counting candidates outside quoted fields. When a semicolon file contains values such
as 12,5 and none such as 12.5, the decimal comma is detected
as well and those values become numbers. You can set either one yourself if the file is
unusual.
Several CSVs, one workbook
Drop several files and each becomes its own sheet, named after its file. Excel is strict
about sheet names. They can be at most 31 characters long and cannot contain
[ ] : * ? / \. Two sheets cannot differ only in capital letters, and the name
History is reserved. Names are adjusted to follow the rules and every
change is listed, so 2024/Q1 sales.csv becomes a sheet you can still
recognise. A file with more than 1,048,576 rows, the limit for one sheet, continues on
a second sheet with the header repeated. Opening the same file in Excel would warn you
and leave the extra rows out.
What the workbook contains
A standard .xlsx file that opens in Excel, Google Sheets, LibreOffice and
Numbers. Header cells are text, with filter buttons on the header row, and column
widths are set from the longest value so nothing is hidden behind
#####. Line breaks inside quoted fields stay inside their cells. A byte
order mark at the start of the CSV is removed rather than glued onto the first
heading. The CSV is read with the same parser as the other data tools on this site,
which follows RFC 4180.
Next steps
Going the other way, Excel to CSV exports every sheet with dates and full-precision numbers, and Excel to JSON turns a sheet into typed objects. If the CSV is too large to handle, split CSV breaks it up without cutting through a quoted field. CSV to JSON converts it for code instead of a spreadsheet. All of them are on the data tools page.