Why Numbers and Excel change CSV files on a Mac
You open a CSV, everything looks almost right, and then you notice the ZIP codes have lost their zeros, or an order ID now says 1.23457E+15. The file wasn’t “corrupt.” The spreadsheet guessed.
Short answer: a CSV has no types. Every field is text. Numbers and Excel import that text and convert what they think are numbers and dates. Opening the file doesn’t have to damage it; saving writes the guessed values back. In Excel you can often prevent this by importing and setting columns to Text. Numbers has no per-column import option. If you only need to read the file, use something that doesn’t import it.
What gets changed
Three guesses cause almost all of the damage:
- Leading zeros.
02134becomes2134. ZIP codes, account numbers, and some employee IDs live or die on that padding. - Long IDs. Anything with more than 15 significant digits doesn’t fit in the kind of number a spreadsheet uses.
1234567890123456becomes1.23457E+15on screen, and the digits past the fifteenth are gone. Saving writes the damaged value. - Dates.
3-4can become 4 March. Text that looks like a date, or like a gene name from an old list, can go the same way.
Quoted fields don’t reliably stop this. The quotes mean “this field may contain commas,” not “leave this as text.”
How to avoid it in Excel
Don’t double-click the file. Import it:
- Open Excel, then choose Data > Get Data > From Text/CSV (Microsoft 365) or File > Import.
- Set the delimiter.
- For every column that should stay as written — IDs, ZIP codes, phone numbers, anything long — set the column type to Text.
- Save a spreadsheet copy if you need one. Do not save over the original CSV unless you have checked the values against the source.
If the file is already open and the IDs are already in scientific notation, changing the format to Text will not bring the lost digits back. You need the original file.
What to do in Numbers
Numbers lets you pick an encoding and a separator when it opens a file. It does not let you set a column to text on the way in. The guessing still happens.
Workarounds people use (they’re also on Ask Different):
- Edit a copy of the CSV first, and turn critical fields into text Excel/Numbers will respect, such as
="02134", then import that copy. - Prefix IDs with something non-numeric (
ID:00001234), import, then strip the prefix with a formula — only if you still have a trustworthy source string.
Both are fiddly, and both mean you’re no longer looking at the file you were sent. If you don’t need a spreadsheet, skip them.
When to use a viewer instead
If the job is to look — confirm the export, find a row, check that the IDs still match the system they came from — open the file in a viewer, or even in Terminal with less -S. Those show the text as it is.
Free options, including sqlite3 (which stores imported values as text, so zeros survive) and the row limits of Numbers and Excel, are in How to open a large CSV file on a Mac. A comparison of Mac viewers, including ones I didn’t write, is in CSV viewers for Mac.
I made Comma for this: it shows the file, it never writes it, and it keeps leading zeros and long IDs. $10 after a 14-day trial. If you need to edit the cells and save, use a CSV editor instead; I say so on that comparison page.
Questions
Will setting a Numbers column to Text fix IDs that already look wrong?
No. The digits are already gone. Go back to the original CSV.
Does quoting a field in the CSV protect it?
Usually not. Quotes control delimiters, not types.
Is this only a Mac problem?
No. Excel on Windows does the same kind of conversion. The Numbers catch is specifically the missing import-as-text step.