CSV ⇔ JSON Converter

Convert CSV to JSON and JSON to CSV. Save the CSV as UTF-8 with BOM or Shift_JIS so Excel opens it without garbled text. You can also open Shift_JIS and EUC-JP CSV files directly.

Examples:

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 asIn ExcelUse it for
UTF-8 without BOMMay be garbledPrograms, web services, APIs
UTF-8 with BOMOpens correctlyCSV you will open in Excel
Shift_JISOpens correctlyOlder 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", 12 and true become a number and a boolean. Values with leading zeros like 007, 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 become column3. 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.
  • null becomes 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

  • 007 becomes 7 (leading zeros are dropped)
  • Digits after the 15th in a long number are replaced with 0
  • Values like 1-2 or 3/4 turn 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

EnvironmentCode
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.jsfs.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.