Why a naive `.split(',')` breaks real CSV#
A spreadsheet export that contains a comma inside a value — an address, a product name with a comma in it, a quoted quote — wraps that value in double quotes: "Doe, Jane". Splitting on every comma blindly turns that one field into two columns and shifts everything after it by one, silently corrupting the row. This tool implements the actual CSV grammar (RFC 4180): a quoted field can contain commas and newlines, and a doubled quote "" inside a quoted field means a literal quote character — the same rules Excel and Google Sheets use when they export.
What happens with uneven rows#
Real-world CSV is rarely perfectly rectangular. A row with fewer fields than there are header columns gets the missing columns filled in as empty strings, so the JSON stays valid instead of producing objects with different shapes. A completely blank line between rows is skipped rather than turned into a phantom empty record.
Converting JSON back to CSV#
The reverse direction expects a flat JSON array of objects — the column set is the union of every key seen across all objects, in the order each key first appears, not alphabetical. A value that is itself an object or array is serialized as a JSON string inside its cell rather than rejected, since that is usually more useful than an error when one field in an otherwise-flat structure happens to be nested.