Using CSV to JSON: practical guide
Prepare your CSV
The first row is normally used as the field names, so make sure it contains clear, unique headings with no blanks. Each following row becomes one JSON object, which is the shape most APIs and scripts expect.
Things that trip people up
Values with commas inside them must be wrapped in quotes, otherwise they split into extra columns. Some regions use semicolons as the separator, so check the delimiter. Numbers may arrive as text, and leading zeros in codes such as postal numbers can be lost if they are treated as numbers.
- Save spreadsheets as UTF-8 CSV so accented characters survive.
- Remove empty trailing rows, which otherwise become empty objects.