Fix Mojibake and Encoding Errors in CSV Files
Resolve garbled text caused by encoding mismatches in your CSV files. Learn to detect UTF-8 vs Latin-1 conflicts, strip the BOM, and re-save files correctly for ecommerce imports.
- ✓What mojibake is and why it appears in CSV files
- ✓How to identify UTF-8 vs Latin-1 (ISO-8859-1) encoding
- ✓How to strip the UTF-8 BOM when a tool misreads it
- ✓Step-by-step fixes in Excel, Google Sheets, and VS Code
- ✓How to prevent re-encoding corruption on every save
Ready to fix your CSV? Upload it for instant validation and auto-fixes.
Open CSV FixerWhat Is Mojibake?
Mojibake is the visual garbage that appears when a file saved in one character encoding is opened or interpreted in a different one. The word comes from Japanese and roughly means "unintelligible characters."
If your CSV contains sequences like these, you have an encoding problem:
| What you see | What it should be |
|---|---|
’ | ’ (right single quotation mark) |
— | — (em dash) |
“ | “ (left double quote) |
é | é (e with accent) |
 at the start of a field | BOM (invisible marker) |
Why Encoding Mismatches Happen
Modern platforms such as Shopify, WooCommerce and Amazon expect UTF-8 encoded files. But many tools produce files in other encodings:
- Microsoft Excel (Windows) saves
.csvin the system locale encoding (often Windows-1252 or Latin-1) unless you specifically choose UTF-8. - Older export tools may default to ISO-8859-1 / Latin-1.
- Copy-paste from websites can smuggle in curly quotes and em dashes encoded as multi-byte UTF-8 characters that break when the file is treated as Latin-1.
When a UTF-8 file is read as Latin-1 or Windows-1252, each multi-byte sequence gets split into individual single-byte characters, producing mojibake. If that garbled text is then saved, the garbage becomes part of the data.
Diagnosing the Problem
Check the encoding of your file
On Mac/Linux:
file -I yourfile.csv
# Example output: yourfile.csv: text/plain; charset=utf-8
On Windows (PowerShell):
# Windows PowerShell 5.1; in PowerShell 7 use -AsByteStream instead of -Encoding Byte
Get-Content yourfile.csv -Encoding Byte -TotalCount 3
# If first 3 bytes are 239 187 191 (0xEF 0xBB 0xBF), the file has a UTF-8 BOM.
Quick visual test: Open the file in a text editor (not Excel) and look at the first character and any accented letters. If the first cell starts with  or descriptions contain â€, the encoding is wrong.
Identify which encoding to use
- Most garbled files are UTF-8 read as Latin-1 or Windows-1252 (or the other way round).
- If the file itself is fine and only the display is wrong, reopen it with the encoding it was really saved in, then re-save it as UTF-8. Sequences like
’usually mean a UTF-8 file is being shown as Windows-1252, so reopen it as UTF-8. - If the garbage is still there when the file is opened as UTF-8, it was saved into the data. Changing the encoding won't remove it; use a repair tool such as Python's
ftfylibrary or Find and Replace.
What Is the BOM?
The UTF-8 BOM (Byte Order Mark) is a three-byte sequence (EF BB BF) that some tools prepend to UTF-8 files. Windows Notepad and Excel sometimes add it automatically.
Why it matters: Some import tools read the BOM as literal characters in the first column name, turning Handle into Handle, and then don't recognise that column. Shopify and WooCommerce handle the BOM, but other tools and scripts may not.
Fix in Excel
Excel is the most common cause of encoding problems. Follow these steps precisely.
Export from Excel as UTF-8
- Open your spreadsheet in Excel.
- Click File → Save As.
- In the "Save as type" dropdown, choose CSV UTF-8 (Comma delimited) (.csv).
- This option is available in Excel 2016 and later on Windows and Mac.
- Do not choose plain "CSV (Comma delimited)". That saves in the system locale encoding.
- Click Save.
Re-open a mojibake file in Excel
If you already have a garbled file:
- Do not double-click the file to open it. That uses the system locale.
- Open a blank Excel workbook.
- Go to Data → From Text/CSV.
- Select your file.
- In the import wizard, set File Origin to the file's real encoding: 65001: Unicode (UTF-8) for UTF-8 files.
- Complete the import, then save as CSV UTF-8.
Fix in Google Sheets
Google Sheets always works in UTF-8 internally. The risk is in downloading:
- Import: Go to File → Import → Upload and select your CSV. Sheets detects encoding automatically.
- Export: Go to File → Download → Comma Separated Values (.csv). Google Sheets exports UTF-8 without BOM. This is safe.
If you received a garbled file that Sheets is displaying incorrectly:
- Import it via File → Import rather than opening it directly.
- In the import dialog, make sure Convert text to numbers, dates, and formulas is unchecked if you have SKUs or barcodes.
Fix with VS Code (Reliable for Any File)
VS Code gives you full control over encoding and is free:
- Open VS Code and drag your CSV file into it.
- Look at the bottom-right status bar. It shows the detected encoding (e.g.,
UTF-8,Windows 1252). - Click the encoding label.
- Choose "Reopen with Encoding" and select the encoding the file was actually saved in (often
Western (Windows 1252)orISO 8859-1). - The garbled text should now display correctly. If it shows
’-style sequences while VS Code saysWindows 1252, the file is really UTF-8: reopen it as UTF-8 instead. - Click the encoding label again and choose "Save with Encoding → UTF-8".
This two-step process (reopen with the original encoding, then save as UTF-8) is the most reliable method for any tool.
Fix with Windows Notepad
For a quick fix on Windows (Windows 11 / 10 version 1903+):
- Open the garbled file in Notepad.
- Go to File → Save As.
- In the Encoding dropdown, select UTF-8 (not "UTF-8 with BOM").
- Save.
Note: Older versions of Notepad only offered "UTF-8 with BOM" which adds the invisible BOM marker. If your Notepad does not have a "UTF-8" (without BOM) option, use VS Code instead.
Preventing Re-encoding Corruption
Once your file is clean, protect it going forward:
- Always use "CSV UTF-8" in Excel, never plain CSV.
- Never re-open a UTF-8 CSV by double-clicking in Windows. Windows associates
.csvwith Excel which may open it in the locale encoding. Use Data → From Text/CSV in Excel, which lets you choose the encoding. - Validate encoding after every export using a tool like StriveFormats or a command-line check before uploading.
- If your import platform's export tool consistently produces Latin-1, convert the file immediately after downloading using VS Code or a script before editing.
Quick Reference: Encoding Symptoms and Fixes
| Symptom | Likely cause | Fix |
|---|---|---|
’ — in text | UTF-8 file shown as Windows-1252 | Reopen as UTF-8; if it's still garbled, repair it with ftfy |
 at start of first column | UTF-8 BOM | Strip BOM; use "UTF-8 without BOM" |
é è à | UTF-8 file shown as Latin-1 or Windows-1252 | Reopen as UTF-8; if it's still garbled, repair it with ftfy |
? replacing all special chars | Encoding lost on conversion | Original data may be lost; re-export from source |
| Correct in Sheets but garbled when downloaded | Download encoding wrong | Use File → Download → CSV (Google uses UTF-8) |
Upload your CSV to StriveFormats for instant validation, auto-fixes, and a clean export.

