Why Excel shows garbled text for UTF-8 CSV
When you double-click a CSV file, Excel has to guess its encoding. On a Japanese edition of Windows it often falls back to Shift_JIS (code page 932), so a UTF-8 file with Japanese text turns into strings like "繧ウ繝ウ…". Some Excel versions and settings do recognize BOM-less UTF-8, but you can't count on it.
| Saved as | In Excel | Use it for |
|---|---|---|
| UTF-8 without BOM | May be garbled | Programs, web services, APIs |
| UTF-8 with BOM | Opens correctly | CSV you will open in Excel |
| Shift_JIS | Opens correctly | Older Japanese systems and import tools |
The BOM is three bytes at the start of the file (EF BB BF) that tell Excel the file is UTF-8. Some programs don't expect it and will read the first column name as name, so leave it off for CSV that a program will read.
Characters that Shift_JIS doesn't have, such as emoji, are replaced with "?" when saving, and the tool lists them in the error line. Its Shift_JIS covers the same range as Windows code page 932, so characters like ① and ㈱ are saved as they are.
When a CSV is already garbled
Choose the file and the tool detects UTF-8, Shift_JIS or EUC-JP automatically; you can also pick the encoding yourself. If the text was garbled before you got the file, try the Mojibake Fixer.
To fix it on the Excel side, don't open the CSV directly. Use Data → From Text/CSV and set "File Origin" to 65001: Unicode (UTF-8) or 932: Japanese (Shift-JIS).
CSV → JSON rules
- The first row becomes the keys, and the result is an array of objects. Turn the header option off to get an array of arrays.
- Every value is a string. With "Convert numbers and true/false",
12andtruebecome a number and a boolean. Values with leading zeros like007, and numbers longer than 15 digits (IDs, for example), stay strings because converting them would change the value. - Commas, line breaks and doubled quotes (
"") inside quoted cells are read correctly. - Duplicate header names get a suffix (
name_2) and empty ones becomecolumn3. Missing cells are filled with empty strings.
JSON → CSV rules
- An array of objects uses the union of all keys as columns; objects without a key get an empty cell.
- An array of arrays becomes rows as-is. An array of plain values becomes a single column named
value. - Nested objects and arrays are written into one cell as a JSON string. Flatten the JSON first if you want separate columns.
nullbecomes an empty cell. Only values containing the delimiter, a quote or a line break are wrapped in double quotes.
Other ways Excel changes your data
007becomes7(leading zeros are dropped)- Digits after the 15th in a long number are replaced with
0 - Values like
1-2or3/4turn into dates
This happens when Excel reads the file, not in the CSV itself. Import with Data → From Text/CSV and set the column type to Text to prevent it.
Doing it in code
| Environment | Code |
|---|---|
| Python (save with BOM) | df.to_csv('out.csv', index=False, encoding='utf-8-sig') |
| Python (read a Shift_JIS CSV) | pd.read_csv('in.csv', encoding='cp932') |
| Python (JSON → CSV) | pd.read_json('in.json').to_csv('out.csv', index=False, encoding='utf-8-sig') |
| Node.js | fs.writeFileSync('out.csv', '' + csv) |
| PHP (write the BOM first) | fwrite($fp, "\xEF\xBB\xBF"); then fputcsv() |
| Shell (UTF-8 → Shift_JIS) | iconv -f UTF-8 -t CP932 in.csv > out.csv |
| jq (JSON → CSV) | jq -r '(.[0]|keys_unsorted) as $k | $k, (.[]|[.[$k[]]]) | @csv' in.json |
In Python, use cp932 instead of shift_jis. The shift_jis codec raises errors on characters like ① and ㈱.
To check or reformat the JSON itself, use the JSON Formatter; to see the raw bytes in each encoding, use the Hex Encoder.
FAQ
Excel shows garbled text when I open my CSV. How should I save it?
Set "Save CSV as" to "UTF-8 with BOM" and save. If it is still garbled, use Shift_JIS. For a CSV that is already garbled, choose the file and re-read it with a different encoding.
Is my data sent to a server?
No. The conversion runs entirely in your browser; neither pasted text nor selected files are uploaded.
Can it read tab-separated (TSV) or semicolon-separated files?
Yes. With the delimiter set to Auto, it picks one from the first row. If it guesses wrong, choose the delimiter yourself.
Some characters become "?" when I save as Shift_JIS
Characters that Shift_JIS (code page 932) doesn't have, such as emoji, are replaced with "?". The tool lists them before saving. Use UTF-8 with BOM if you can't lose them.
What happens to nested JSON values?
Nested objects and arrays are written into a single cell as a JSON string. They are not expanded into columns.
Can it handle large files?
It works in browser memory, so tens of megabytes is a practical limit; files over 20 MB are not loaded. For bigger files, convert with code such as Python.