CSV Encoding on Mac, Excel, and UTF-8
If José shows up as José, or £ becomes £, the CSV is not “corrupt.” The bytes were decoded with the wrong text encoding.
This is one of the most common CSV headaches on a Mac, especially when the file came from Excel on Windows.
What CSVUtility tries on Automatic
CSVUtility always works with UTF-8 internally. Other encodings are converted when the file opens.
On Automatic import encoding, CSVUtility:
- Honour a BOM if present: UTF-8 (
EF BB BF), UTF-16 LE (FF FE), or UTF-16 BE (FE FF). - If there is no BOM, check whether the bytes are valid UTF-8 (this is faster on files larger than 1 MB, and it reports progress so a huge file can be cancelled).
- Look for UTF-16 without a BOM (ASCII text with a blank byte beside every character).
- Try Windows-1252 next. That is what Excel on Windows usually writes. It fails only on a few unused bytes.
- Try ISO Latin-1 last, because it can decode any byte and would otherwise hide a better match.
- If nothing else worked, treat the bytes as UTF-8 anyway.
The exact BOM the file opened with is kept and written back on save, so a round trip does not quietly strip UTF-8 with BOM.
Override a bad guess
Some legacy files are valid under more than one single-byte encoding. Automatic cannot know which one you meant.
CSV Utility → Settings… (⌘,) → Import & Export → Import encoding:
- Automatic
- UTF-8
- UTF-8 with BOM
- UTF-16 Little Endian
- UTF-16 Big Endian
- Windows-1252
- ISO Latin-1
Set Windows-1252, re-open the file, and check a known name. If it looks right, File → Export Copy… and choose UTF-8 (or UTF-8 with BOM if a Windows Excel user has to double-click it next).
Import delimiter on the same pane is Comma, Tab, Semicolon, Pipe, or Automatic. Wrong delimiter plus wrong encoding is a miserable debugging session. Fix encoding first, then columns.
Default Export Copy encoding and line endings (LF vs CRLF) are also on that Settings pane.
Why Excel is usually involved
Excel for Windows has a long history of opening CSV as the system ANSI encoding (often Windows-1252), then saving something that is not UTF-8. Excel for Mac has an import dialog. Double-clicking a .csv skips the dialog and guesses.
If you care about the file, open it in CSVUtility instead of double-clicking into Excel.
Browser tools
The CSV to JSON converter decodes whatever the browser already turned into text (usually UTF-8 paste). If paste looks wrong, fix encoding in CSVUtility first, then copy the cells.
Practical rule
Ship UTF-8 to APIs, git, and other Macs. Ship UTF-8 with BOM only when a specific Windows Excel workflow requires it. Do not “fix” glyphs by find-and-replace until the Import encoding is correct. You will bake the garbage in.
Download CSVUtility if you are still fighting this in TextEdit.