Excel CSV Weird Characters? Fix UTF-8 Mojibake Fast

Equalang

In brief

Fix weird characters like é or € when opening UTF-8 CSV files in Excel using Data From Text/CSV, a UTF-8 BOM (utf-8-sig), or Google Sheets.

Keywords: excel csv weird characters; excel csv special characters; google sheets utf 8 csv; excel import csv special characters; utf-8 bom excel

Double-clicking a valid UTF-8 .csv file in Microsoft Excel often turns accented letters, currency symbols, and CJK text into weird characters like Café, München, or €. This happens because a plain .csv file has no metadata header declaring its character encoding, so classic Excel falls back to your operating system's legacy regional codepage (Windows-1252, GBK, Shift_JIS, or MacRoman) unless the file starts with a 3-byte UTF-8 Byte Order Mark (EF BB BF). You can fix it in under a minute without losing column boundaries or leading zeros—just do not press Ctrl+S while the garbled text is on screen, or Excel will permanently overwrite your clean file with corrupted characters.

Quick Comparison: 3 Ways to Open UTF-8 CSVs Cleanly

Choose the fix that matches where the .csv comes from and who needs to open it:

MethodBest ForPreserves Leading Zeros (00412)?Works on Double-Click in Excel?
1. Excel Data > From Text/CSVOpening an existing CSV without altering the file on diskYes (set column type to Text in preview)No (requires importing from a blank workbook)
2. Prepend UTF-8 BOM (EF BB BF)Exporting CSVs from Python, scripts, or databases for Excel usersNo (Excel still auto-casts numeric strings on double-click)Yes
3. Google Sheets / LibreOffice CalcInspecting or converting a UTF-8 CSV directly into .xlsxYes (when unchecking automatic number conversion or exporting)Yes (after saving as .xlsx)

Fix 1: Import via Data > From Text/CSV (And Keep Leading Zeros)

When someone sends you a .csv exported from Shopify, Stripe, PostgreSQL, or a macOS/Linux tool, double-clicking bypasses Excel's encoding selector. Importing through the Data tab forces Excel to read the file as 65001: Unicode (UTF-8) and gives you a chance to lock SKU or phone columns before Excel strips their leading zeros.

  1. Open Microsoft Excel and start a Blank workbook (do not double-click the .csv file).
  2. Go to the Data tab on the ribbon and click From Text/CSV in the Get & Transform Data group.
  3. Select your .csv file and click Import.
  4. In the preview window that appears, look at the File Origin dropdown at the top left. Change it from the default regional codepage (such as 1252: Western European (Windows)) to 65001: Unicode (UTF-8).
  5. Check the preview table—Café and other garbled strings should immediately snap back into clean text (Café).
  6. Optional (Protect leading zeros and long IDs): If your sheet has ZIP codes, phone numbers, or SKUs like 00412, click Transform Data at the bottom right to open Power Query. Select those columns, change their Data Type from Whole Number to Text, and click Close & Load.
  7. If you don't need column type adjustments, simply click Load.

Fix 2: Add a UTF-8 BOM (EF BB BF) So Double-Clicking Just Works

If you generate .csv files for teammates or clients who will inevitably double-click them in File Explorer or Finder, telling everyone to use Data > From Text/CSV every time rarely sticks.

Instead, prepend a 3-byte UTF-8 Byte Order Mark (BOM)—hex bytes EF BB BF (\xEF\xBB\xBF)—at byte 0 of the file. When Excel sees those three bytes at the start of a .csv, it immediately switches to UTF-8 decoding on double-click.

In Python (pandas or standard csv)

By default, pandas.DataFrame.to_csv() writes standard UTF-8 without a BOM (encoding="utf-8"). Change the encoding parameter to utf-8-sig so Python writes the 3-byte BOM header automatically:

import pandas as pd

df = pd.DataFrame({
    "city": ["München", "São Paulo", "東京"],
    "item": ["Café", "Crème brûlée", "抹茶"],
    "price": ["€4.50", "€6.00", "¥600"]
})

# Standard UTF-8 without BOM (garbles on Excel double-click)
# df.to_csv("report_no_bom.csv", index=False, encoding="utf-8")

# UTF-8 with BOM (opens cleanly on Excel double-click)
df.to_csv("report_excel_ready.csv", index=False, encoding="utf-8-sig")

If you use Python's built-in open() and csv.writer, pass encoding="utf-8-sig" to open():

import csv

with open("report_excel_ready.csv", "w", newline="", encoding="utf-8-sig") as f:
    writer = csv.writer(f)
    writer.writerow(["city", "item", "price"])
    writer.writerow(["München", "Café", "€4.50"])

In macOS or Linux Terminal

To fix an existing UTF-8 .csv file from the command line without opening an editor, prepend the \xEF\xBB\xBF byte sequence using printf and cat:

printf '\xEF\xBB\xBF' | cat - clean.csv > excel_ready.csv

Inside Excel (Save As)

If you already imported a file cleanly and want to save a .csv copy that others can double-click:

  • Go to File > Save As and choose CSV UTF-8 (Comma delimited) (*.csv) from the file type dropdown—do not choose the older CSV (Comma delimited) (*.csv) or Macintosh Comma Separated (*.csv) options.

When NOT to Use a UTF-8 BOM

While Excel relies on the UTF-8 BOM for double-click detection, the Unicode specification notes that a BOM is neither required nor recommended for UTF-8 streams in general Unix/Linux pipelines. Strict command-line parsers or legacy scripts that do not strip \xEF\xBB\xBF will treat those three invisible bytes as part of your first column header name (turning "id" into "\ufeffid"). Keep two mental rules:

  • Delivering .csv files to human Excel users: Use utf-8-sig (UTF-8 with BOM).
  • Feeding .csv files into strict Linux CLI tools or database ingestion pipelines: Use standard utf-8 (without BOM).

Fix 3: Open via Google Sheets or LibreOffice Calc

If you don't want to touch terminal commands or Excel's Power Query dialog, open the file in a spreadsheet app that defaults to UTF-8:

  • Google Sheets: Open a blank sheet -> File > Import > Upload -> select your .csv file. Google Sheets automatically detects standard UTF-8 without a BOM. Once imported, click File > Download > Microsoft Excel (.xlsx) to hand off a native Excel workbook where character encoding is never ambiguous.
  • LibreOffice Calc: Opening any .csv immediately pops up an import dialog where you can verify that Character set is set to Unicode (UTF-8) and mark specific columns as Text before clicking OK.

If you also need to translate a multilingual .csv or .xlsx product sheet without breaking comma delimiters or UTF-8 encoding, see our guides on how to translate a CSV file and how to translate an Excel file.

Why Does Café Turn Into Café in Excel?

Seeing é or € in a spreadsheet looks like random file corruption, but it is completely deterministic. Here is what happens under the hood:

  1. Standard .csv files are raw byte streams: Unlike .xlsx (which is a zipped package of XML files explicitly declared as UTF-8), a .csv file has no header metadata. Every modern data tool—Python pandas, PostgreSQL, Shopify, Stripe, Google Sheets, and macOS/Linux utilities—exports .csv files in UTF-8 without BOM.
  2. UTF-8 uses 2 to 4 bytes for non-ASCII characters: Basic English ASCII letters (A-Z, 0-9) use a single byte (0x00 to 0x7F), which looks identical in UTF-8 and legacy codepages. Anything outside basic ASCII uses multiple bytes:
    • é (U+00E9) is encoded in UTF-8 as two bytes: C3 A9.
    • ü (U+00FC) is encoded in UTF-8 as two bytes: C3 BC.
    • € (U+20AC) is encoded in UTF-8 as three bytes: E2 82 AC.
  3. Excel falls back to the OS legacy codepage: When you double-click a .csv lacking a BOM, classic Excel decodes each byte using the local system's legacy 8-bit or DBCS codepage (Windows-1252 on Western Windows, GBK on Simplified Chinese Windows, Shift_JIS on Japanese Windows, or MacRoman).

When Windows-1252 reads UTF-8 multi-byte sequences one byte at a time, you get predictable mojibake:

Original TextUTF-8 Hex BytesDecoded as Windows-1252Decoded as GBK (Simplified Chinese Windows)
Café43 61 66 C3 A9Café (C3 = Ã, A9 = ©)Café or trailing garbled symbol
München4D C3 BC 6E 63 68 65 6EMünchen (C3 = Ã, BC = ¼)M黱chen
€100E2 82 AC 31 30 30€100 (E2 = â, 82 = ‚, AC = ¬)Garbled CJK + 100
日本語E6 97 A5 E6 9C AC E8 AA 9E日本語 (9 Latin-1 characters)涓枃 / garbled hanzi pairs

Because the underlying bytes on disk are still valid UTF-8, closing the file without saving leaves your data intact. The moment you hit Ctrl+S inside Excel, however, Excel re-encodes the broken Café characters back to disk, permanently replacing the original text.

Frequently Asked Questions

Why did saving my CSV in Excel permanently ruin the characters?

When Excel opens a UTF-8 .csv using a legacy codepage like Windows-1252, the on-screen text is already decoded into wrong characters (such as Café). Pressing Ctrl+S writes those wrong characters back out to disk, overwriting the original UTF-8 byte sequences. If you already saved over the file, re-export the .csv from your source system—or restore the previous file version—before applying Fix 1 or Fix 2.

Why does Google Sheets open the exact same CSV without weird characters?

Google Sheets ignores your computer's local Windows or macOS regional codepage and assumes incoming .csv uploads are encoded in standard UTF-8 by default. Since almost all web apps and databases export UTF-8 without a BOM, Google Sheets renders them cleanly right away.

How do I stop Excel from deleting leading zeros (00412) or turning long numbers into 1.23E+15 when opening a CSV?

Adding a UTF-8 BOM fixes character encoding on double-click, but Excel will still auto-convert numeric-looking strings into numbers—stripping leading zeros from ZIP codes or SKUs and truncating 16-digit IDs. To preserve leading zeros, always use Data > From Text/CSV, click Transform Data, and set those specific columns to the Text data type before loading.

Sources