JSON to CSV Without Flattening
Sometimes you want JSON-to-CSV conversion but you do not want the converter to recursively expand every nested object into dotted columns.
Native JSON tool
JSON to CSV
Top-level keys become columns only
Nested values stay as JSON
Narrow output, easy to read
Lossless round-trip preserved
- 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.
When keeping JSON inside cells is the right choice
Flattening is the default in most JSON-to-CSV tools because it produces analyst-friendly columns. But flattening is not always what you want. If your nested objects are opaque, such as a metadata blob with hundreds of keys you do not care about, flattening produces a sea of irrelevant columns. If your CSV is destined for re-import into a JSON-aware tool, flattening throws away structural information that downstream code needs. If your audience treats the CSV as a transport format rather than an analysis target, narrow output with JSON-encoded cells is easier to scan than wide output with hundreds of dotted columns.
The no-flatten mode in FixTools keeps top-level keys as the column set and writes nested values, both objects and arrays, as compact JSON strings in their cells. The cell content is a single line of valid JSON that any tool with a JSON parser can re-hydrate into the original structure. Excel and Google Sheets display the JSON string as opaque text, which is the right behaviour because there is no useful spreadsheet operation on raw JSON anyway. Pandas can re-parse the cell with json.loads when the analyst needs to drill into the nested data.
The CSV escaping rules apply correctly to JSON-encoded cells. Because JSON strings contain literal double quotes, every cell with JSON content gets enclosed in double quotes and every internal double quote gets doubled per RFC 4180. The result is a slightly bulkier cell but a fully spec-compliant CSV that opens cleanly in any tool. The encoded JSON inside the cell preserves Unicode characters in their natural form because the surrounding UTF-8 CSV can carry them directly, which means there is no need for the JSON escape sequences like \u00e9 to represent é.
The trade-off is that spreadsheet-side analysis of the nested data is impossible without re-parsing. If the analyst needs to filter on a field inside a nested object, they have to either re-parse the JSON in their tool of choice or go back and run the conversion again with flattening enabled. Many teams hand both versions to the analyst: the flat version for filter and pivot, the JSON-preserved version for archival and re-import. FixTools makes generating both quick because the source JSON is already pasted; you just toggle the flatten setting and re-download.
How to use this tool
Convert JSON to CSV using only top-level keys as columns. Nested objects and arrays are written as JSON strings inside their cells.
How It Works
Step-by-step guide to json to csv without flattening:
- 1
Paste your JSON
Paste your JSON into the editor or upload a .json file. The parser shows top-level keys and any nested structures.
- 2
Switch flatten depth to 0
In the options panel, set flatten depth to 0 or pick the no-flatten preset. This tells the converter to use only top-level keys as columns and to serialise nested values as JSON strings.
- 3
Confirm in preview
The preview table shows narrow columns with JSON-encoded text in cells that contain nested objects or arrays. Width should be much smaller than a fully flattened version.
- 4
Download the CSV
Download the CSV. Open it in Excel or your tool of choice. The nested fields appear as JSON text that downstream code can re-parse when needed.
Real-world examples
Common situations where this approach makes a real difference:
Archive CSV for re-import to JSON
A data engineer needs a CSV archive of API responses that can be re-imported into a JSON-aware tool later. No-flatten mode preserves the original structure as JSON-encoded cells, so a future re-import pulls back the same shape.
Audit log export
A security engineer exports audit logs as JSON and needs a CSV for record-keeping. The nested event details are not for spreadsheet analysis but must be preserved exactly. No-flatten mode keeps every field intact.
Lightweight CSV transport
A mobile app dev generates CSVs as an export format for end users. Wide flattened columns would overwhelm the UI. No-flatten produces a narrow CSV that downloads quickly and re-imports cleanly into the same app.
Backup of API responses
A QA engineer keeps daily snapshots of API responses for regression testing. No-flatten mode preserves the original shape so diff tools compare structure faithfully across snapshots.
Pro tips
Get better results with these expert suggestions:
Pair no-flatten with a flattened sibling
Generate two CSVs from the same JSON: one flattened for analysts to pivot on, one not flattened for archive and re-import. Both versions live alongside each other in storage and serve different audiences without compromise.
Use compact JSON in cells
FixTools writes JSON-encoded cells in compact form (no extra whitespace) to keep the CSV small. If you need pretty-printed JSON inside cells for readability, switch the cell-format option in the panel.
Re-parse cells with json.loads in pandas
When loading the no-flatten CSV in pandas, apply df["col"].apply(json.loads) to a JSON-encoded column to re-hydrate it into Python dicts or lists. This is the standard pattern for downstream analysis of preserved-structure CSVs.
Watch row size for very large nested objects
A CSV row containing several deeply nested JSON objects can become large. Most spreadsheet tools have per-cell character limits in the tens of thousands. If a cell exceeds the limit, flatten that particular path instead.
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