CSVCSV GUIDE
Home›CSV Complete Guide›Garbled characters
Detail Guide 03 · Troubleshooting

Fixing garbled characters in CSV files

Garbled text ("mojibake") is almost always down to one thing: an encoding mismatch, and once you isolate it the repair takes about ten minutes. This page covers how to identify the cause, three ways to fix it, and the working habits that stop it coming back.

Updated October 30, 2026Reading time about 10 minutesSources official documentation only
THE SHORT ANSWER

The cause is a mismatch between the encoding used to save the file and the encoding used to read it. There are three fixes: (1) reopen it through Excel's Data → From Text/CSV and specify the encoding — recommended and safe; (2) convert the encoding in Notepad or PowerShell and save a copy; (3) in code, pass the encoding explicitly (cp932, utf-8-sig and so on). Saving over a garbled file destroys the original bytes, so check first whether you have overwritten it.

TOOLFix the garbled text right nowEverything described on this page can be done in the browser.
Contents
  1. What garbled text actually is
  2. The two encodings behind Japanese CSV
  3. Identifying the cause
  4. Fix 1: reopen in Excel
  5. Fix 2: convert the encoding
  6. Fix 3: set it in code
  7. Rules that stop it recurring
  8. When it cannot be fixed
  9. Frequently asked questions
01Theory

What garbled text actually is

When a CSV opens and shows character salad instead of readable text — café where you expected café, or a run of unrelated symbols where you expected Japanese — the data is not damaged. The bytes inside the file are exactly as they were; the program reading them is interpreting them as a different encoding.

The same text, saved as UTF-8 and then opened as Shift-JIS, comes out as nonsense, and vice versa. Garbled text is therefore a mismatch between the encoding used to write the file and the one used to read it, and reopening with the correct encoding restores it completely.

Sources (checked October 30, 2026)
02Background

The two encodings behind Japanese CSV

EncodingMain usesCharacteristics
Shift-JIS (CP932)Japanese Windows business software, legacy Excel formats, government filingsTwo bytes per Japanese character. Cannot represent emoji or some kanji
UTF-8The web, cloud services, modern systems in generalUniversal. Behaviour differs depending on whether a BOM is present

A BOM (byte order mark) is a marker at the start of a UTF-8 file, and with one present Excel can recognise the file as UTF-8. So if the file is going to be opened in Excel, UTF-8 with BOM — Excel's "CSV UTF-8" option — is the safe choice.

On the search "what is CSV UTF-8"

That search is really asking what it means to save a CSV as UTF-8. The answer: the characters in the file are recorded in UTF-8, a universal standard. If the receiving system expects UTF-8, switching the encoding at save time is all it takes.

03Diagnose

Identifying the cause

  1. Open the file in Notepad (or VS Code)Editors normally detect the encoding automatically. If the text looks correct there, the problem is on the reading side — Excel's assumption.
  2. If the editor shows garbage too, reopen with a different encodingIn VS Code, use Reopen with Encoding and try Shift-JIS, then UTF-8. Whichever one displays correctly is the file's real encoding.
  3. Check whether you have already saved over the garbled fileIf you have, skip to When it cannot be fixed. If not, carry on with the repair steps below.
Sources (checked October 30, 2026)
04Repair

Fix 1: reopen it through Excel's import dialog (recommended)

  1. Do not double-click the CSV — open a blank workbook in Excel instead
  2. Choose Data → From Text/CSV and pick the file
  3. Switch the encoding under File Origin in the previewUse 65001 for UTF-8 and 932 for Shift-JIS. Once the preview shows readable text, you have the right one.
  4. Click LoadThe data lands in the sheet already displaying correctly.

Because this approach never writes to the file, it is the safest of the three.

Sources (checked October 30, 2026)
05Repair

Fix 2: convert the encoding and save a copy

Here you convert the file itself to whatever encoding the recipient needs. For a single file, Notepad is enough.

  1. Open the file in NotepadThis assumes it is displaying correctly in whatever encoding Notepad picks.
  2. Choose Save As and change the EncodingPick ANSI (which means Shift-JIS) or UTF-8, then save.
  3. Open it in the target system to confirmAlways run an acceptance check after converting.

If you need to convert a whole folder of files, the command line is faster.

PowerShell (Shift-JIS → UTF-8)
# Convert every .csv in the folder to UTF-8 (with BOM)
Get-ChildItem *.csv | ForEach-Object {
$t = Get-Content $_.FullName -Encoding Default
$t | Set-Content $_.FullName -Encoding UTF8
}
Sources (checked October 30, 2026)
06Repair

Fix 3: specify the encoding in code

When code reads the file, stating the encoding every single time is the only real fix. For Japanese CSV files, four values cover essentially every case.

ValueMeaningWhen to use it
cp932The Windows flavour of Shift-JISCSV exported by Japanese business software
shift_jisPlain Shift-JISOld government datasets (a few symbols differ from cp932)
utf-8UTF-8 without BOMCSV from the web or cloud services
utf-8-sigUTF-8 with BOMReading and writing files saved as Excel's "CSV UTF-8"
Python
import pandas as pd

# Read a CSV saved by Excel (no need to worry about the BOM)
df = pd.read_csv("data.csv", encoding="utf-8-sig")
# CSV from Japanese business software
df2 = pd.read_csv("data2.csv", encoding="cp932")

If you run into an error, see the encoding cheat sheet on the reading and writing guide.

07Process

Rules that stop it happening again

  1. Agree the encoding at every handoverWrite it down rather than leaving it verbal: "Shift-JIS for external submissions, UTF-8 for tool integrations".
  2. Put the encoding in the file nameA name like "sales_2026_utf8.csv" tells the recipient what they are dealing with.
  3. Standardise on "CSV UTF-8" when you export from ExcelDrop to Shift-JIS for a specific recipient only when you have actually seen it break in their environment.
  4. Always convert a copyNever overwrite the original file.
Sources (checked October 30, 2026)
08Limits

When it cannot be fixed (you already saved over it)

Data saved while garbled generally cannot be recovered

If the text is only displayed incorrectly because the wrong encoding was used to read it, reopening with the right one restores it. But once a garbled rendering is written back to disk, the original byte sequence is gone and no encoding will bring it back.

Your options:

  • Re-obtain the data from its source — the system that exported it, or the person who sent it
  • Look for the original in email attachments (Outlook and similar), shared-folder version history, or your downloads folder
  • In a few narrow cases (a UTF-8 → Shift-JIS → UTF-8 round trip, for example) a manual repair tool can help, but do not count on it

"Getting back to the state before I overwrote it" is not an encoding technique — it is a backup problem. Build the habit of copying any important CSV the moment it arrives.

Sources (checked October 30, 2026)
09FAQ

Frequently asked questions

Q.Why do CSV files end up garbled in the first place?

Because the encoding used to save the file differs from the one used to read it. Japanese text exists in both Shift-JIS and UTF-8, so which one gets assumed is always the question.

Q.What is the quickest fix if Excel shows garbage?

Reopen the file with "Data" → "From Text/CSV" and switch the encoding in the preview to 65001 (UTF-8) or 932 (Shift-JIS). Nothing on disk is modified, so it is completely safe.

Q.I already saved the garbled CSV. Can it be fixed?

Generally no. Re-obtain the original data from its source. If the text is only being displayed incorrectly and has not been saved, you can still recover it.

Q.What is the difference between UTF-8 and UTF-8 with BOM?

The BOM is a three-byte marker at the start of the file that lets Excel recognise it as UTF-8. Some programs choke on it, so be careful with recipients that require BOM-less UTF-8.

Q.How can I find out the encoding of a CSV someone sent me?

Open it in VS Code and the detected encoding appears in the status bar. In Notepad, the Encoding field on the Save As dialog shows what it currently assumes.

Sources (checked October 30, 2026)