CSV to JSON
Convert CSV to JSON and back, with correct handling of quoted fields and embedded commas.
Paste CSV data to convert it.
Features
- Both directions, CSV to JSON and JSON to CSV
- RFC 4180 quoted fields with embedded commas and newlines
- Four delimiter options including tab-separated
- Optional automatic type detection
- Headerless mode produces arrays instead of objects
How to use it
- Pick a direction and paste your data.
- Confirm the delimiter and whether row one is a header.
- Press Convert.
- Copy the result or download it as a file.
Why CSV parsing is trickier than splitting on commas
The naive approach, splitting each line on commas, breaks on the first field that contains one. RFC 4180 allows any field to be wrapped in double quotes, and a quoted field may contain commas, line breaks and even quotes, provided each embedded quote is doubled. So "Wilmslow, Cheshire" is one field, and "She said ""hi""" is the single value She said "hi".
That last rule means you cannot process CSV line by line either. A quoted field containing a newline spans multiple physical lines while remaining one logical record. This parser walks the input character by character tracking whether it is inside quotes, which handles all of these cases correctly.
Type detection is convenient but occasionally destructive, which is why it is a toggle. Turning it on converts 42 to a number and true to a boolean, usually what you want. But it also converts a US zip code like 02134 to the number 2134, losing the leading zero, and can mangle long identifiers that exceed JavaScript's safe integer range. Turn it off when your columns contain codes rather than quantities.
Frequently asked questions
Related tools
Further reading
Read the full guide on the 123MiniApps blog.