How to convert CSV to JSON (or back)
- 1.
Pick a direction
Switch between “CSV → JSON” and “JSON → CSV”, then paste your data or load a .csv, .tsv or .json file.
- 2.
Set the options
For CSV input: delimiter (auto-detected by default), header row and type inference. For JSON input: flattening, output delimiter, BOM and decimal comma.
- 3.
Check the preview
The result and a table preview appear instantly, with the number of rows and columns, so you can spot a wrong delimiter right away.
- 4.
Copy or download
Copy the output or download it as data.json or data.csv.
CSV rules the parser follows (RFC 4180)
CSV looks simple, but naive “split on comma” code breaks on real exports. This converter implements the rules from RFC 4180 plus the usual real-world deviations:
- A field that contains the delimiter, a double quote or a line break must be wrapped in quotes:
"Doe, Jr.". - A quote inside a quoted field is written twice:
"she said ""hi""". - A quoted field may span several lines, which is common in exported comments or addresses.
- Rows can end with CRLF (Windows), LF (macOS, Linux) or a bare CR; a trailing empty line is ignored.
- A UTF-8 byte order mark at the start of the file is removed automatically.
Example: the row John,"Doe, Jr.",25,8.99 with type inference on and no header becomes ["John","Doe, Jr.",25,8.99] - four values, not five.
Delimiter detection and European Excel files
Not every CSV uses commas. Excel follows the list separator of the operating system, so in Germany, France, Poland, Italy and most of continental Europe it saves CSV files with a semicolon, because the comma is the decimal separator there (12,50). Exports from databases often use a tab (TSV) or a pipe. The auto-detection parses the first 30 rows with each candidate and picks the one that gives the most consistent column count greater than one.
When you load a file, the tool first tries strict UTF-8. If that fails, it falls back to Windows-1252, the legacy encoding older Excel versions use in Western Europe and the US, so characters like é, ü or £ are not mangled.
Going the other way, Excel does not always recognise UTF-8. Keep Add BOM on and accented or non-Latin characters will display correctly. If your colleagues use Excel in a European locale, choose the semicolon delimiter and turn on the decimal comma so numbers land in proper numeric cells.
Type inference and flattening nested JSON
By default every CSV value is a string. With type inference on, 42, -3.5 and 1e3 become numbers, true/false become booleans, and empty fields or null become null. Values with leading zeros (007, ZIP codes such as 02134) and very long integers such as card or account numbers stay strings, because converting them would silently lose data.
For JSON → CSV, nested objects can be flattened with dot notation: {"address":{"city":"London"},"tags":["a","b"]} becomes the columns address.city, tags.0 and tags.1. The column list is the union of keys from all records, so records missing a key simply get an empty cell. With flattening off, nested values are written into one cell as JSON text.
The input can be an array of objects, an array of arrays or a single object. Everything is processed locally in your browser, so customer lists and internal exports never leave your computer. For pretty-printing or validating the JSON itself, use the JSON formatter.
Frequently asked questions
Why does my CSV from Excel use semicolons instead of commas?
+
Why do I see garbled characters when I open the CSV in Excel?
+
How do I convert nested JSON to CSV?
+
Will ZIP codes or IDs with leading zeros be changed?
+
Is my data uploaded anywhere?
+
How large a file can I convert?
+
Updated: