A large JSON file, thousands of records exported from an API or a database, is an awkward thing to convert in one shot. If something looks wrong in the output, you are scanning a huge table for the problem. If one record is malformed, the whole conversion is in question. If the result is not what you expected, your only move is to redo everything.
Working in sections fixes all three complaints. You split the array into smaller pieces, convert each piece on its own, check each piece while it is still small enough to read, and stack the pieces at the end. This guide walks through that workflow with the free JSON to CSV Converter on Ovatly, and it is upfront about the one real trap: the sections can disagree about columns.
Contents
- Quick answer
- Why convert in sections at all
- The trap: every section builds its own columns
- How to convert in sections, step by step
- Worked example: two sections, two headers
- Aligning the headers before you stack
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
The JSON to CSV Converter has no batch or section feature; it converts what you paste or upload in one pass. Converting in sections is a workflow you run yourself: split the JSON array into smaller arrays, convert each one separately, then stack the resulting CSV files. The trap is that the columns are the union of the keys in each section, so two sections can produce different header rows. Before stacking, compare the headers and align them, or make sure one record carrying every key used anywhere in the file sits in the first section, so its header is already complete.
Why convert in sections at all
Three practical reasons. First, checking: a section of a few hundred records produces a CSV you can eyeball, so a flattened column that looks wrong or a value that landed oddly gets caught while the fix is cheap. Second, isolation: if one stretch of the file contains a record that breaks the pattern, converting in sections tells you which stretch it is in instead of leaving you to search the whole file. Third, recovery: if a section needs redoing, you redo that section, not the entire conversion.
None of this requires a special feature: a list can be cut anywhere between records, and the converter does not care that your paste is one slice of a bigger file.
The trap: every section builds its own columns
The converter builds its columns as the union of all keys in the input, in first-appearance order. Feed it the whole file and the header is complete by definition. Feed it one section and the header is the union of that section's keys only.
Real files are rarely uniform. Early records might carry name and city, while a key like age or discount only shows up in records added later. Convert the first half on its own and there is no age column. Convert the second half and there is. Stack those two files as they stand and the second file's rows have one more field than the first file's header, so every value after the gap sits under the wrong heading. The conversion did nothing wrong; the stacking did.
This is the single thing to plan around, and the next sections show both the check and the shortcut.
How to convert in sections, step by step
- Split the JSON array into smaller arrays of records, cutting only between records so each piece is still a valid array of objects on its own. Keep the pieces in order and name them by sequence.
- Open the JSON to CSV Converter, paste or upload the first section, and note the record and column counts it reports. The record count should match how many records you put in.
- Download that section's converted.csv and repeat for each remaining section, keeping the outputs in the same order as the pieces.
- Before combining anything, compare the header rows of all the section files, following the alignment step below.
- Stack the files: one header row at the top, then each section's data rows in order, without their header rows.
Worked example: two sections, two headers
Suppose a file of customer records is split in two. The first section holds the familiar Ana and Ben records; the second introduces a key the first never uses:
[
{ "name": "Ana", "address": { "city": "Lisbon" } },
{ "name": "Ben", "address": { "city": "Porto" }, "age": 31 }
]
[
{ "name": "Chen", "address": { "city": "Macau" }, "age": 44, "discount": true }
]
Converted separately, the sections produce different headers:
name,address.city,age
Ana,Lisbon,
Ben,Porto,31
name,address.city,age,discount
Chen,Macau,44,true
The second header has a fourth column, discount, that the first file knows nothing about. If you stacked these as they stand, Chen's row would carry four fields under a three-column header. The data survived conversion perfectly; it is the combination that needs one deliberate step.
Aligning the headers before you stack
Lay the header rows side by side and find every column that appears in any section. That full list, in a consistent order, is the header of the final file. For each section, add any missing columns as empty fields in the right positions: a section without the discount key gets an empty discount field per row. In the example, the first section's rows each gain a trailing empty field, and the shared header becomes name, address.city, age, discount.
The shortcut avoids most of this. If the first section contains at least one record that carries every key used anywhere in the file, its header is already the complete one, because the union rule picks up all of them. Placing such a record early turns alignment into a quick comparison instead of a rebuild. Either way, verify the final file's row width: every data row should have exactly as many fields as the header.
Limitations and honest tradeoffs
The honest points first. There is no batch mode, no section mode and no combine feature in the converter; the splitting, converting and stacking are your workflow, with the converter as one step inside it. The converter writes values exactly as they appear and never reformats them, so sections will not drift in formatting, but it will not tidy anything for you either. Simple arrays inside a record are joined with "; " into one cell, and arrays of objects become JSON text in the cell, in every section alike. And a section made of plain scalars or a mixed array is rejected with an explanation, since it has no clear columns; that rejection is information about the file, not a failure of the method.
Common mistakes
- Stacking sections without comparing headers. The classic failure of this workflow. Different column sets shift values under the wrong headings.
- Keeping every section's header row in the stack. The combined file should carry the header once; repeated headers become fake data rows in the middle of the table.
- Cutting the array in the middle of a record. Each section must be a valid array of objects by itself, or the conversion has nothing sound to work with.
- Losing the order of the sections. Number the pieces as you split. A stack assembled out of order is a quietly wrong file.
FAQs
Does the converter have a batch or section mode? No. It converts the JSON you paste or upload in one pass. Converting in sections means splitting the array yourself, converting each piece, and combining the CSV files afterwards.
Why do two sections of the same file have different columns? Because the columns are the union of the keys in whatever you converted. If a key appears only in records from the second half of the file, the first section has no column for it, and the second section does.
How do I stack the section files into one CSV? First make every section share the same header row, adding missing columns as empty fields in the same positions. Then keep the header once at the top and append each section's data rows underneath it, in order.
Can I put a record with every key in the first section to fix the headers? Yes, and it is the simplest alignment trick. If the first section contains at least one record carrying every key used anywhere in the file, its header already has every column, and later sections only need checking against it.
Is my JSON uploaded to a server when I convert it? No. The conversion runs locally in your browser and nothing is uploaded. Each converted.csv is generated on your device and downloaded from there.
Conclusion
Converting a large JSON file in sections is a manual workflow, and this guide has not pretended otherwise: the JSON to CSV Converter converts one paste at a time, and you supply the splitting, the checking and the stacking. Do the header comparison honestly and the method is sound, because each section stays small enough to verify. For the companion topic, our guide to delimiters and quoting explains why the resulting file opens cleanly in Excel, and the rest of the series lives in the Data and JSON Tools guides.
References
- RFC 4180, the common format and MIME type for CSV files, which the section outputs and the stacked file both follow: https://www.rfc-editor.org/rfc/rfc4180