Free · Fast · Privacy-first

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

Runs in your browser
CSV output
Run the tool to see a task-specific result.

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
IframeResponsiveAttribution included

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. 1

    Paste JSON

    Paste your JSON containing arrays.

  2. 2

    Set array mode to keep-intact

    In the options panel, choose Keep Arrays (or JSON-encode) for the array-handling option.

  3. 3

    Preview

    Check that array cells contain JSON-encoded strings and that row count matches record count.

  4. 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:

1

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.

2

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.

3

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.

4

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.

FAQ

Frequently asked questions

As JSON-encoded strings inside cells. The cell content is a single-line compact JSON representation of the array, such as ["a","b","c"]. The CSV escaping rules apply (the cell is enclosed in double quotes because the JSON content contains commas), and downstream code can re-parse the cell with JSON.parse to recover the original array.
Yes, as plain text. Excel does not parse JSON-encoded cells but displays the content correctly. Analysts can inspect cells visually or copy them into a JSON viewer for closer examination.
Spreadsheets cannot directly filter or pivot on fields inside a JSON-encoded cell. For that kind of analysis, run a second conversion with explode mode, which produces one row per array element with parent fields duplicated.
Yes. Every value and every nested field is preserved exactly in the JSON-encoded cell. JSON.parse on the cell recovers the original array exactly, including nested objects and any depth.
Very large arrays produce large cells, which can hit spreadsheet cell-size limits (Excel caps cells at 32,767 characters). For arrays approaching that size, consider explode mode or split the source into multiple records.
Yes. Apply df["col"].apply(json.loads) to re-hydrate the JSON-encoded cells into Python lists or dicts. This is the standard pattern for downstream analysis of preserved-array CSVs.
No. One source record produces exactly one row. Row count equals record count, which is the key invariant keep-intact preserves and explode does not.

Related guides

More use-case guides for the same tool:

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

Source-backed reference

JSON standards quick reference

Concise, standards-backed facts for developers working with JSON debugging and validation. Each rule links to a primary specification so it can be independently verified before you rely on it in code, documentation, or an incident report.

JSON standard
RFC 8259 defines JSON as a text format for serializing structured data. JSON values may be objects, arrays, strings, numbers, true, false, or null.
Verify in RFC 8259
Strings and object keys
JSON strings and object member names use double quotation marks. Single-quoted strings are not valid JSON syntax.
Verify in RFC 8259 §7
Trailing commas
The JSON grammar does not allow a comma after the final member of an object or the final element of an array.
Verify in RFC 8259 §4–5
Interoperability
ECMA-404 describes the JSON syntax independently of any programming language, which is why standard parsers can exchange the same JSON text across runtimes.
Verify in ECMA-404

Common invalid → valid JSON examples

Trailing comma

{"a":1,}{"a":1}

Single-quoted key

{'a':1}{"a":1}

Unsupported literal

{"score":NaN}{"score":null}

Built for verification, not just extraction

Direct answers are paired with primary sources and concrete examples. That makes this page useful to developers and also gives search and answer systems a clear, verifiable statement to reference instead of an unsupported summary.