JSON to CSV Keeping Arrays
Arrays inside JSON records present a conversion choice: explode them into multiple rows, or keep them intact as a single cell? Keeping arrays intact preserves the record-per-row mapping at the cost of arrays being JSON-encoded strings rather than analyzable columns.
Native JSON tool
JSON to CSV
Arrays as JSON-encoded cells
One row per source record
Lossless array preservation
Re-parseable in downstream code
- Cost
- Free tier
- Sign-up
- Not required
- Processing
- Tool-specific
- Privacy
- Clearly disclosed
Add this JSON to CSV to your website
Drop the JSON to CSV into a blog post, product docs, intranet, or school portal with one iframe. Processing, privacy, and usage limits are the same as on the full tool page.
- One copy-ready line of HTML
- Responsive — adapts to any container width
- No API credentials are placed in the snippet
Embed code
<iframe
src="https://www.fixtools.io/json/json-to-csv?embed=1"
width="100%"
height="780"
frameborder="0"
style="border:0;border-radius:16px;max-width:900px;"
title="JSON to CSV by FixTools"
loading="lazy"
allow="clipboard-write"
></iframe>Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.
Why preserving arrays in-cell often makes sense
The natural alternative to keep-intact is row-explode, where each array element becomes its own row and parent fields are duplicated across rows. Explode is friendly for spreadsheet analysis because each element can be filtered independently. But explode breaks the one-record-one-row invariant, which matters when the CSV is meant to mirror the source JSON faithfully, or when row count drives downstream logic (such as row count being the number of orders, not the number of line items across all orders).
Keep-intact preserves the invariant. Each record produces exactly one row. Arrays within the record become JSON-encoded strings in their respective cells. The cell content is a single line of compact valid JSON like ["a","b","c"] or [{"id":1},{"id":2}]. Spreadsheet apps display the cell as plain text; analysts can copy the cell into a JSON viewer or re-parse in code if they need to drill in.
Lossless preservation is the other key benefit. A JSON-encoded array cell contains every element and every nested field of every element. Re-parsing the cell with JSON.parse or json.loads recovers the original array exactly. This makes keep-intact the right choice for archival CSVs, for round-trip workflows where the CSV may be re-imported to JSON, and for any case where downstream code may need to access the array structure programmatically.
The downside is spreadsheet analysis of the array contents. A pivot table cannot pivot on a field inside a JSON-encoded cell because the spreadsheet sees the cell as opaque text. If your analyst needs to filter on a specific array element's field, run a second conversion in explode mode and hand them that version alongside the keep-intact version. Many teams keep both for different purposes.
How to use this tool
Keep JSON arrays intact as JSON-encoded cells in the CSV. One row per source record, lossless preservation of array structure.
How It Works
Step-by-step guide to json to csv keeping arrays:
- 1
Paste JSON
Paste your JSON containing arrays.
- 2
Set array mode to keep-intact
In the options panel, choose Keep Arrays (or JSON-encode) for the array-handling option.
- 3
Preview
Check that array cells contain JSON-encoded strings and that row count matches record count.
- 4
Download
Download the CSV. Arrays remain as JSON strings in their cells, ready for downstream re-parsing or visual inspection.
Real-world examples
Common situations where this approach makes a real difference:
Archival CSV of orders with line items
A finance team archives orders monthly. Each order has a line-items array. Keep-intact preserves one row per order with line items as JSON-encoded cells. Row count equals order count, which finance reconciles against the source system.
Round-trip workflow
A team converts JSON to CSV for editing in a spreadsheet, then converts back to JSON. Keep-intact preserves array structure so the round-trip is lossless.
Data lake load
A data lake load pipeline accepts CSV with JSON-encoded array cells, parses them in downstream Spark jobs, and reconstructs the nested structure. Keep-intact produces the right shape for this pattern.
Audit log mirror
An audit log JSON has arrays of event metadata. The CSV mirror keeps the arrays intact for archival purposes; row count maps one-to-one to log entries.
Pro tips
Get better results with these expert suggestions:
Pair with an explode CSV for analyst use
Generate two CSVs: keep-intact for archive and analyst-pivot for analysis. Both versions live alongside each other and serve different audiences.
Watch cell size for large arrays
A very large array in a single cell can exceed spreadsheet cell size limits (typically 32,767 characters in Excel). If your arrays are large, consider trimming or splitting before conversion.
Re-parse with JSON.parse in scripts
Downstream scripts that need to access array contents can apply JSON.parse to the cell value. In pandas, df["col"].apply(json.loads) re-hydrates the cells.
Use compact JSON encoding
The default encoding is compact (no whitespace) to minimise cell size. Pretty-printed JSON in cells is harder to scan and uses more space.
Frequently asked questions
Related guides
More use-case guides for the same tool:
Related tools
Other tools you might find useful:
Ready to get started?
Open JSON to CSV to review its free limits and processing method.
Open JSON to CSV →Free tier · No account needed · Transparent limits