Most CSV to JSON conversions that go wrong do not fail loudly. The file converts, the JSON looks plausible, and the damage shows up later: a product missing from the import, fields blank for no reason, prices the app rejects because they arrived as text.
Nearly all of it traces back to three things: the header setting, the shape of the rows, and what type you expected the values to be. This guide walks through the five failures, using the free CSV to JSON Converter on Ovatly, so you can spot each one before the file reaches the app.
Contents
- Quick answer
- Mistake 1: header on, but the file has no header
- Mistake 2: header off, but the app expects objects
- Mistake 3: ragged rows padded into fake blanks
- Mistake 4: expecting numbers, getting strings
- Mistake 5: totals rows becoming fake records
- How to convert without the damage, step by step
- Worked example: one file, two outcomes
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
Before you convert, answer three questions about the file: does it have a header row, is every row the same length, and does the receiving app expect objects or arrays? Set the header option to match the file: with it on, the first row becomes the field names. Expect short rows padded with empty strings, and every value, prices included, to stay a string. The CSV to JSON Converter does exactly what the file and the setting tell it to. The mistakes below are mismatches between the two, not tool errors.
Mistake 1: header on, but the file has no header
This is the most destructive mistake here, because it deletes a record and disguises the deletion as structure. With the header option on, the converter takes the first row as field names. If that row was actually data, your first product becomes the keys of every object in the output and never appears as a record itself.
Nothing looks broken: the JSON is valid, the count is one short, and the keys are oddly specific, a person's name where a field name should be. If your keys read like data, this is what happened. The fix costs nothing: turn the option off and convert again, and the row returns as the first record in an array of arrays.
Mistake 2: header off, but the app expects objects
The mirror image. With the header option off, the output is an array of arrays: each row a plain list of values with no names attached. Every value is present and correct, but the shape is wrong for an app that reads fields by name.
An importer expecting objects looks for a "price" key and finds a position instead. If the file has a header row, leave the option on. Turn it off only for a file with no header whose receiving side wants bare rows.
Mistake 3: ragged rows padded into fake blanks
Real spreadsheets have ragged rows: a product with no stock count, a contact missing its last column. When a row is shorter than the header, the converter pads it with empty strings so every object still has every key. The conversion succeeds, and the output gains blank fields nobody typed.
The danger is that a padded blank looks exactly like a deliberately empty cell. It reads as "this product has no price" when the truth is "this row was a column short". When you see blanks, count the fields in the source row before you believe them.
Mistake 4: expecting numbers, getting strings
Every value in the output is a string. A price of 499 comes out as the text "499", an age of 31 as "31". Apps that do arithmetic on those fields, or validate them as numbers, will complain.
It is deliberate design, and the reason is in your own data: the guessing that would turn "499" into a number would turn the SKU 007 into 7, destroying the code. The converter refuses to guess, so nothing is silently reinterpreted. If the receiving app needs numbers, that conversion is its job, or a step you run after importing.
Mistake 5: totals rows becoming fake records
Spreadsheets end with summaries: a Total row, a count, a note. The converter treats every row as data, with no way to know the last line is a summary, not a product. Convert the sheet as-is and the totals line becomes one more object in the array, with your headers as its keys and the word Total in the name field.
It then imports like a product, which is how phantom items appear in catalogues. The defence is dull and total: delete summary rows from the CSV before you convert, every time.
How to convert without the damage, step by step
- Read the first line and decide, honestly, whether it is a header or data.
- Scan the rows: check each has the same number of fields, and delete totals rows at the bottom.
- Open the CSV to JSON Converter, paste the CSV or upload the file, and set the header option to match step 1.
- Convert, then spot-check: count objects against your data rows, read the keys, and inspect the first and last.
- Download converted.json only when the count, keys and shapes look right.
Worked example: one file, two outcomes
The converter's example file has a header and two rows:
name,age
Ana,31
Ben,28
With the header option on, it gives two objects, and even the ages stay strings:
[
{ "name": "Ana", "age": "31" },
{ "name": "Ben", "age": "28" }
]
Now delete the header row, leave the option on, and convert the data rows alone. The output is a single object, { "Ana": "Ben", "31": "28" }: Ana has been promoted into the field names and lost as a record. Same file, same tool, opposite outcome, decided entirely by whether the setting matched the file.
Limitations and honest tradeoffs
The converter cannot detect any of these mistakes. It does not know whether your first row is a header, does not warn when it pads a short row, and will not type a value that looks numeric. It follows the setting and the file exactly: delimiter auto-detected, quoted fields read by the standard rules, values copied as written, all locally in your browser.
That honesty cuts both ways. A successful conversion tells you the file was readable, nothing more. Whether it was read the way you meant is a check only you can run, which is why the spot-check in step 4 is part of the process.
Common mistakes
- Leaving the header setting unchecked. The first row decides the shape of everything; look at it first.
- Trusting a successful conversion. Success means readable, not correct. Count the objects and read the keys.
- Hunting for a data bug that is really a totals row. A strange extra record at the end is usually your own summary line.
- Fixing string prices by hand in the JSON. Convert types on the receiving side, in bulk, not one at a time.
FAQs
How do I know if my CSV has a header row? Look at the first line. If it names the columns, words like name, age or price, instead of holding data, it is a header row and the header option should be on. If the first line is already a product or a person, the file has no header and the option should be off.
Why did one record disappear from my JSON? The header option was probably on for a file without a header row. The converter used the first row as field names, so that record became the keys of every object instead of a record of its own. Turn the option off and convert again.
Why are some fields blank strings in the output? A row shorter than the header is padded with empty strings so every object has the same keys. The padding is automatic, so a blank can mean a genuinely empty cell or a row that was missing a column entirely. Check the source row to find out which.
Why is my price a string and not a number? By design. The converter never guesses types, which is what keeps codes like 007 intact. If the receiving app needs numbers, it has to convert the strings on its side, or you convert them after importing.
Can a totals row end up in the JSON? Yes. The converter treats every row as data, so a totals or summary line at the bottom of a sheet becomes one more object in the array. Delete summary rows from the CSV before you convert.
Conclusion
None of these five failures needs a better tool; they need a setting that matches the file and thirty seconds of checking. Match the header option to the first row, clear out summary lines, expect strings, and count the objects before the file travels. Our companion guide runs the same converter over a full product list: How to Turn a Product List from CSV into JSON for Your Store. For more in this series, see the Data and JSON Tools guides.
References
- RFC 4180, the common format for CSV files, on the header line and quoted fields: https://www.rfc-editor.org/rfc/rfc4180
- RFC 8259, the JSON data interchange format, on objects, arrays and string values: https://www.rfc-editor.org/rfc/rfc8259