Common causes
A comma inside a value
The reader sees Oslo and Norway as two values, so Ann's row has three where the header has two.
Input
name,city Ann,Oslo, Norway Bob,Bergen
CSV JSON says
Row 2 has 3 fields but row 1 has 2 (line 2). There is an extra delimiter, or a value with a delimiter in it is not quoted
A missing value
A row that stops early is one value short. If Ann has no city, write the comma anyway so the empty value is there.
Input
name,city Ann Bob,Bergen
CSV JSON says
Row 2 has 1 field but row 1 has 2 (line 2). A field is missing, or a delimiter is inside a value that is not quoted
A trailing comma
A comma at the end of a row starts one more value, even if nothing follows it.
Input
name,city Ann,Oslo, Bob,Bergen
CSV JSON says
Row 2 has 3 fields but row 1 has 2 (line 2). There is an extra delimiter, or a value with a delimiter in it is not quoted
The value in quotes
Quotes keep the comma inside the value, and every row has two values again.
Input
name,city Ann,"Oslo, Norway" Bob,Bergen
CSV JSON says
[{"name":"Ann","city":"Oslo, Norway"},{"name":"Bob","city":"Bergen"}]
How to fix it
- Wrap any value that contains the delimiter in double quotes: "Oslo, Norway".
- Give every row the same number of delimiters. Write an empty value as nothing between two commas.
- Remove a trailing delimiter, or add a header name for the extra column.
- If values contain many commas, export with a tab or semicolon as delimiter and choose the same one in the converter.
- Paste the text into the CSV JSON converter: the message names the row and line that does not fit.