How to Fix CSV Files Broken by Excel
Excel converts CSV values on open, not on save, so the damage happens before you notice it. Leading zeros disappear from postcodes and product codes, dates are rewritten into the local format, numbers longer than fifteen digits become scientific notation, and UTF-8 accents turn into mojibake. The fix is to import rather than open, forcing every column to text.
CSV to JSON Converter
Turn CSV rows into a clean JSON array of objects.
The critical detail is that Excel guesses a type for every column the moment the file opens, and that guess is destructive. Once a postcode has lost its leading zero the original value is gone; saving the file afterwards writes the damaged version back to disk.
This is why an export that was correct on the server arrives corrupted in a colleague's spreadsheet. Nothing in the pipeline was broken except the act of double-clicking the file.
Step by step
-
Never double-click the file
Open Excel first, then use Data, then From Text/CSV. This gives you the import dialog, which is the only place you can override the type guessing before it happens.
-
Set every column to Text
In the import preview, select all columns and set the type to Text. Nothing is lost by importing as text — you can convert deliberately afterwards — whereas anything Excel converts automatically is unrecoverable.
-
Choose UTF-8 explicitly
Set the file origin to 65001: Unicode (UTF-8). Without this, an accented name such as Müller is read as Windows-1252 and becomes Müller. A file that opens correctly on one machine and not another is almost always this.
-
Check the four usual casualties
Look at a postcode or product code with a leading zero, a date column, an ID longer than fifteen digits, and any non-English name. If all four survived the import, the rest of the file is almost certainly fine.
-
Work outside the spreadsheet where you can
If the goal is to reshape or convert the data rather than to look at it, skip Excel entirely. A converter reads the CSV as text throughout and cannot silently retype a column.
Example
The same three rows before and after Excel guessed the column types.
Original CSV
code,ordered,barcode
00421,2026-03-04,9780306406157
00088,2026-11-12,9781861972712
After Excel opened it
code,ordered,barcode
421,04/03/2026,9.78031E+12
88,12/11/2026,9.78197E+12
Frequently asked questions
Why does Excel remove leading zeros from my CSV?
Why do long numbers become 9.78031E+12?
Why do accented characters turn into strange symbols?
Does saving as CSV from Excel cause the same problem?
Is there a way to keep double-clicking safe?
Tools used in this guide
All tools →- CSV to JSON Converter Turn CSV rows into a clean JSON array of objects. In your browser
- CSV Column Extractor Keep only the columns you need from a CSV file. In your browser
- Text Cleaner Strip formatting, smart quotes and invisible characters. In your browser
- Excel Column Converter Convert between column letters (AB) and column numbers (28). In your browser
Related guides
All guides →- How to Convert CSV to JSON Turn a spreadsheet export into a clean JSON array, with the delimiter and header options that matter.
- CSV vs JSON Flat tables or nested structures — which format suits the data and the reader.
- How to Fix Broken Characters in Text Diagnose mojibake, question marks and invisible characters, and repair the text.
Last reviewed .