Excel CSV Weird Characters? Fix UTF-8 Mojibake Fast
EqualangIn 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:
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.
- Open Microsoft Excel and start a Blank workbook (do not double-click the
.csvfile). - Go to the Data tab on the ribbon and click From Text/CSV in the Get & Transform Data group.
- Select your
.csvfile and click Import. - 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)) to65001: Unicode (UTF-8). - Check the preview table—
Caféand other garbled strings should immediately snap back into clean text (Café). - 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 fromWhole NumbertoText, and click Close & Load. - 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 olderCSV (Comma delimited) (*.csv)orMacintosh 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
.csvfiles to human Excel users: Useutf-8-sig(UTF-8 with BOM). - Feeding
.csvfiles into strict Linux CLI tools or database ingestion pipelines: Use standardutf-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
.csvfile. 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
.csvimmediately pops up an import dialog where you can verify that Character set is set toUnicode (UTF-8)and mark specific columns asTextbefore 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:
- Standard
.csvfiles are raw byte streams: Unlike.xlsx(which is a zipped package of XML files explicitly declared as UTF-8), a.csvfile has no header metadata. Every modern data tool—Pythonpandas, PostgreSQL, Shopify, Stripe, Google Sheets, and macOS/Linux utilities—exports.csvfiles in UTF-8 without BOM. - UTF-8 uses 2 to 4 bytes for non-ASCII characters: Basic English ASCII letters (
A-Z,0-9) use a single byte (0x00to0x7F), 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.
- Excel falls back to the OS legacy codepage: When you double-click a
.csvlacking a BOM, classic Excel decodes each byte using the local system's legacy 8-bit or DBCS codepage (Windows-1252on Western Windows,GBKon Simplified Chinese Windows,Shift_JISon Japanese Windows, orMacRoman).
When Windows-1252 reads UTF-8 multi-byte sequences one byte at a time, you get predictable mojibake:
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.