ComfyToolkit

Data Converter

Convert between JSON, YAML, TOML and CSV.

Input
1
Output
1

JSON to CSV Converter

Turn a JSON array of objects into rows and columns, usually so it can go into a spreadsheet or a tool that only ingests tabular data.

This page opens with JSON as the input and CSV as the output.

It only works on tabular shapes

CSV has exactly one level of structure. An array of flat objects converts cleanly, with keys becoming the header row. Nested objects and arrays have nowhere to go and must be flattened into path-style column names or serialised into a single cell.

If your JSON is a deeply nested document rather than a list of records, extract the array you actually want as rows first.

Quoting is where exports break

Any field containing a comma, a quote or a newline must be quoted, and embedded quotes doubled, per the RFC 4180 convention. Getting this wrong is what produces a spreadsheet where one row has spilled across three.

name,note
Acme,"Ltd, trading as Acme"
Beta,"He said ""hello"""

Long numeric strings are a spreadsheet hazard

Spreadsheets aggressively coerce on import: a long numeric identifier becomes scientific notation, and a leading zero disappears. That is the receiving application rather than the CSV, but the data is damaged all the same. Where identifiers matter, import as text rather than double-clicking the file.

Column order comes from the first record

Headers are derived from the keys of the first object. If later records carry keys the first one lacks, those columns need reconciling rather than being silently dropped.

Normalising the records so every object has the same keys before converting avoids the problem entirely, and is worth doing when the JSON came from an API that omits null fields.

Open the full Data Converter