A JSON to CSV export that produces one row instead of one row per record almost always comes down to what shape of JSON you pasted, not a converter bug. The JSON to CSV converter builds rows from the structure it receives: an array of objects becomes one row per object, while a single top-level object becomes a single row, no matter how much data is nested inside it. If you copied a raw API response straight from a network tab, there is a good chance you pasted an object that wraps your records rather than the records array itself. This article walks through why that happens, a four-step fix, how nested arrays differ from record arrays, and a quick CSV quoting check based on RFC 4180.
Table of Contents

Why Your JSON to CSV Export Shows Only One Row
Most APIs do not return a bare array of records. Instead they wrap the array in an object alongside metadata such as pagination info or a total count. Consider this response:
{
"data": [
{"id": 1, "name": "Ada"},
{"id": 2, "name": "Grace"}
],
"meta": {"total": 2}
}
This is valid JSON and it does contain two records, but at the top level it is a single object with two keys, data and meta. When you paste that whole object into the converter, it correctly produces one data row for that one object, with the data array and the meta object serialized as text inside two cells. That is not a malfunction; it is the converter following the shape you gave it.
To get one row per record, paste only the value of data:
[
{"id": 1, "name": "Ada"},
{"id": 2, "name": "Grace"}
]
That is now a top-level array of two objects, so the converter produces two data rows. Before converting, it is worth running the pasted text through the JSON Validator so you can see the normalized structure clearly and confirm whether the outermost character is { or [.

Four-Step Fix: Extract the Records Array Before Converting
Once you understand the cause, the fix is mechanical. Follow these four steps whenever a JSON to CSV export gives you fewer rows than you expect:
- Locate the array of record objects in the response. Common property names include
data,results, orrecords, but the actual name and nesting depth depend entirely on the API you are working with. - Confirm that what you found is really an array, not the object that contains it. A quick way to check this in code is
Array.isArray(). - Copy that array, including its outer square brackets, and paste only that into the converter. Do not paste the surrounding object.
- Convert and compare the number of data rows produced with the number of elements in the array you copied. They should match exactly.
If you already have the parsed response available in JavaScript, a short check confirms you grabbed the right value before you copy anything:
const records = payload.data;
if (!Array.isArray(records)) {
throw new Error('Expected a records array');
}
console.log(JSON.stringify(records, null, 2));
The property path payload.data is illustrative only; adjust it to match your own API. Array.isArray() tests the actual shape of the value at runtime, and JSON.stringify() with indentation produces text you can paste directly into the converter. If you want to run and inspect that snippet interactively, the JavaScript Editor executes it in the browser and shows console output so you can confirm the array before converting it.

Nested Arrays vs Record Arrays: What Becomes a Row, What Stays a Cell
It is important not to overcorrect once the wrapped-object case is fixed. Arrays nested inside individual records do not turn into extra CSV rows; they stay as cell values. Consider this array of two order records, where each order has its own items array:
[
{"id": 1, "items": [{"sku": "A"}, {"sku": "B"}]},
{"id": 2, "items": []}
]
Here the top-level array has exactly two records, so the converter produces two data rows, not three item rows. Each row’s items cell contains the nested array serialized as JSON text. The converter’s Flatten objects option creates dot-notation columns for nested objects, such as turning address.city into its own column, but it does not expand arrays into additional rows, because doing so would require deciding how to duplicate every other field on the row, a decision the tool cannot make for you automatically.
If you actually want one row per item, reshape the data yourself before pasting it into the converter. Working in a JSON Editor makes it easier to check the intermediate result while you build it:
const rows = orders.flatMap(order =>
order.items.map(item => ({ order_id: order.id, ...item }))
);
This produces a flat array where each element already represents one item, with the parent order id copied onto it, so converting it gives exactly one row per item as intended.
CSV Quoting Check: Commas, Quotes, and Line Breaks per RFC 4180
Once your row count is correct, it is worth a quick sanity check on the quoting inside individual cells, since a value containing special characters can make a CSV file look broken even when the row count is right. RFC 4180 describes a common CSV format: a field containing a comma, a double quote, or a line break should be enclosed in double quotes, and any double quote inside that field should be doubled.
North, west -> "North, west" She said "go" -> "She said ""go"""
A line break inside a properly quoted field does not start a new CSV record; the record only ends at the closing quote followed by the row delimiter. RFC 4180 is an informational description of a widely used CSV convention rather than a rule that JSON arrays must map to rows, but it is still the right reference for whether your delimiter, quoting, and line endings are correct. The converter documents delimiter-aware quoting and CRLF row endings, so this check is mainly about confirming your exported values look right when opened in a spreadsheet, separate from the row-count issue covered earlier.
Troubleshooting JSON to CSV When You Still Get Only One Row
If you have extracted the array and are still seeing an unexpected row count, check two more things before assuming the converter is at fault. First, if Header row is enabled, the CSV output includes a separate header line above the data rows; when counting rows to diagnose a one-row problem, make sure you are counting only data rows and not confusing the header line with a data row. Second, confirm the JSON you pasted is actually valid, since a converter that reports invalid JSON before conversion is a different problem than a row-count problem. Run the pasted text through the JSON Repair tool if you suspect a stray comma or unmatched bracket, then re-check the shape with the JSON Validator once it parses cleanly. Working through these checks in order, shape first, then syntax, resolves the great majority of one-row JSON to CSV exports.
Frequently asked questions
Why does my JSON to CSV converter output one row when my API response has ten records?
The response is probably a top-level object wrapping a records array under a key such as data or results. Paste only that array, not the surrounding object, to get ten rows instead of one.
How do I find the records array inside a wrapped API response?
Look for the property whose value is a square-bracket array of similar objects, often named data, results, or records. Confirm it with Array.isArray() in code or by inspecting the structure in a JSON validator before pasting it into the converter.
Does the Flatten objects option turn nested arrays into extra rows?
No. Flatten objects creates dot-notation columns for nested objects, such as address.city, but nested arrays inside a record stay as JSON text in their cell rather than becoming additional rows.
What is the difference between a header row and a data row when counting rows?
If Header row is enabled, the CSV output has one header line listing column names plus one data row per record. When diagnosing a row-count problem, count only the data rows, since the header line is not a record.
Why is my JSON valid but still converts to the wrong number of rows?
Valid JSON syntax does not specify which nested array represents your CSV records. A validator confirms the text parses correctly, but you still have to choose the correct array yourself before converting.
How should CSV handle a value that contains a comma or a quote?
Per RFC 4180, a field containing a comma, a double quote, or a line break should be wrapped in double quotes, and any double quote inside it should be doubled, for example She said “”go”” inside quotes.
What should I do if the JSON to CSV converter reports invalid JSON before I even get to rows?
Fix the syntax first with a JSON repair or validation tool, since an unmatched bracket or stray comma prevents conversion entirely and is unrelated to the row-count issue.
Next steps
A JSON to CSV only one row result is almost never a defect in the converter; it is a mismatch between the shape of the pasted text and the shape the tool needs, which is an array of record objects at the top level. Locate the records array inside any wrapped API response, confirm it with Array.isArray(), paste only that array, and compare the resulting row count against the array length. Keep nested arrays inside individual records separate from that fix, since they stay as cell values unless you explicitly reshape the data with something like flatMap. Finish with a quick RFC 4180 quoting check on commas, quotes, and line breaks so the file opens cleanly in a spreadsheet. For a broader look at moving data between these two formats, the How to Convert CSV to JSON guide covers the reverse direction with the same attention to structure.
Related tools and resources on HTML Editor Online:
- JSON to CSV
- JSON Validator
- How to Convert CSV to JSON: The Complete Guide for Developers
- JSON Repair
