CSV and JSON model data differently, CSV is flat rows and columns, JSON can nest objects and arrays, so converting between them means making real decisions, not just reformatting text. This converter follows RFC 4180-style CSV rules (double-quoted fields, escaped quotes as "") so commas and line breaks inside a field don't corrupt the parse, optionally infers numbers and booleans from CSV strings, and flattens nested JSON objects into dot-notation columns (like address.city) when converting the other direction.
Any field containing the delimiter, a double quote, or a line break gets wrapped in double quotes on output, and a literal double quote inside that field is escaped by doubling it (""), the same convention RFC 4180 defines. The parser reverses this exactly, so a value like "Smith, John" comes back as one field, not two.
CSV has no concept of a nested object, so a JSON field like {"address":{"city":"London"}} gets rewritten as a single column named address.city with value London. Arrays inside objects are left as their JSON string form rather than flattened further, since there's no clean tabular equivalent for a variable-length list.
By default a CSV cell like 042 or true gets converted to a JSON number or boolean. If a column is meant to stay a string, a ZIP code that starts with a zero, or a code like "true" that's actually a status label, turning inference off keeps every value as a plain string instead.