About csv ↔ json
CSV and JSON are the two most common data formats. Convert a spreadsheet export to JSON for an app, or JSON back to CSV for a spreadsheet.
Watch for
- The first row is treated as column names.
- Values containing commas must be wrapped in quotes.
- Numbers and booleans may arrive as text, so check types after converting.
- Excel exports for some regions use semicolons as the separator.
A worked example
The CSV with the header name,age and the row Asha,30 becomes [{"name":"Asha","age":"30"}]. Note that 30 arrives as text unless the tool is set to detect numbers, so check types before using it in code.
Watch for
- Leading zeros, such as in a PIN code or phone number, which numeric conversion would drop.
- Different delimiters. Some regions export with semicolons.
- Commas and line breaks inside quoted fields.
