3 min read
By HappyCSV Team

Fix CSV Encoding Issues (UTF-8 Guide)

Fix weird characters in your CSV files. Understand UTF-8 vs ANSI, fix mojibake (), and ensure your data displays correctly everywhere.

Fix CSV Encoding Issues (UTF-8 Guide)

You open a CSV file and instead of "Café", you see "Café". Or "José" becomes "Jos".

Welcome to Encoding Hell.

This happens when a file is saved in one "language" (encoding) but opened by a program expecting another. The most common conflict is between UTF-8 (the universal standard) and Windows-1252 (Excel's default).

Here is how to fix it and make your text readable again.

What is Encoding?

Computers store text as numbers (bytes). An "encoding" is the map that tells the computer which number equals which letter.

  • UTF-8: The standard. Supports every character (English, Chinese, Emojis).
  • Windows-1252 / ANSI: Older Windows standard. Supports English and Western European well, breaks on everything else.
  • ASCII: Ancient. Only supports basic English letters.

The Problem: If you save a file as UTF-8 (using 2 bytes for "é") but Excel reads it as ANSI (expecting 1 byte), it misinterprets the data. Result: Garbage text ("Mojibake").

How to Fix It

Method 1: The "Import" Trick in Excel

Don't double-click the CSV. That forces Excel to guess (and it often guesses wrong).

  1. Open a blank Excel workbook.
  2. Go to Data > Get Data > From Text/CSV.
  3. Select your file.
  4. In the preview window, look for "File Origin".
  5. Change it to "65001: Unicode (UTF-8)".
  6. Check the preview. Does "Café" look right?
  7. Click Load.

Method 2: Notepad (Windows)

You can use Notepad to convert the file.

  1. Right-click your CSV > Open with > Notepad.
  2. Does the text look correct here?
    • Yes: The file is good, Excel just read it wrong. Go to step 3.
    • No: The file itself is corrupted or saved in a very weird format.
  3. Click File > Save As.
  4. At the bottom, look for Encoding.
  5. Select UTF-8 (or "UTF-8 with BOM").
  6. Save.

Note: "UTF-8 with BOM" adds a hidden character at the start that tells Excel "Hey, I am UTF-8!". This often makes double-clicking work.

Method 3: TextEdit (Mac)

  1. Open TextEdit.
  2. Cmd+O to open.
  3. Select your file.
  4. Before clicking Open, click Options at the bottom.
  5. Change Plain Text Encoding to Unicode (UTF-8) (or try others if the preview looks wrong).
  6. Open, then Cmd+S to save (ensure UTF-8 is selected).

Method 4: Online Tools

If you don't want to fiddle with system settings, use a tool designed to fix this.

-> Fix CSV Encoding Tool

Preventing Encoding Issues

1. Always Export as UTF-8

When saving from any software, look for settings like "Export charset" or "Encoding". Always choose UTF-8.

2. Use the BOM (Byte Order Mark)

If you are generating CSVs for Excel users, add a BOM (\ufeff) at the very beginning of the file. This forces Excel to switch to UTF-8 mode.

Python Example:

import csv

with open('output.csv', 'w', newline='', encoding='utf-8-sig') as f:
    writer = csv.writer(f)
    writer.writerow(['Name', 'Café'])

utf-8-sig adds the BOM automatically.

3. Avoid "CSV (Macintosh)" or "CSV (MS-DOS)"

In Excel's Save As menu, these are traps. Just use CSV (Comma delimited) or CSV UTF-8 (Comma delimited).

Summary

  • Weird characters = Encoding mismatch.
  • UTF-8 is the solution.
  • Don't double-click to open in Excel; use the Data Import tab.
  • Convert legacy files using Notepad or a dedicated tool.

Encoding still broken? HappyCSV can detect and repair encoding issues instantly.

Need to handle CSV files?

HappyCSV is the free, secure way to merge, split, and clean your data — all in your browser.