# JSON to CSV Guide

Flatten a JSON array of objects into CSV.

- Tool: https://ilham.dev/tools/json-to-csv/
- Guide URL: https://ilham.dev/guides/json-to-csv/
- Tool guides index: https://ilham.dev/guides/tools/
- Broader guide: Working With Structured Data (https://ilham.dev/guides/working-with-structured-data/)

## What it does

Flatten an array of JSON objects into CSV, using the union of the keys as the header row. It is the usual way to get an API response into a spreadsheet.

## Use the tool

Open https://ilham.dev/tools/json-to-csv/, add the input the tool asks for, run it, and check the output before using it elsewhere.

## Input and output

- Input: text.
- Output: text.
- Category: Formats.

## Privacy and processing
Processing happens locally in your browser. This tool does not upload the input to ilham.dev.

## Questions

### What happens to nested objects?

They are flattened into dotted column names like user.address.city. An array inside a row is joined into a single cell, because CSV has no way to express nesting.

### Why are some cells empty?

Because not every object has every key. The header is the union of all keys, so an object missing one simply leaves that cell blank.