Skip to content
Browser tool Runs locally

JSON to CSV Converter

Convert an array of JSON objects into CSV. Runs locally in your browser.

JSON input
CSV output
CSV output will appear here.

What is JSON to CSV conversion?

JSON to CSV conversion turns structured JSON data into a flat, tabular format.

How to convert JSON to CSV

  1. Paste JSON in the input panel.
  2. Click Convert to CSV.
  3. Copy the CSV or download as converted.csv.

How JSON objects become CSV rows and columns

Each object in the array becomes one CSV row. The column headers come from the union of every key found across all the objects, so a record like {"name":"Ana","age":29} contributes a name column and an age column, and every other object in the array is matched against those same columns rather than getting its own separate set.

Nested objects and arrays need flattening

CSV has no way to represent a value inside a value - every cell has to be a single flat piece of text. A nested object such as {"address":{"city":"Lahore"}} is flattened into a dot-notation column named address.city so the nested value still gets a column of its own. An array inside a record, like a list of tags, can't be flattened the same way without changing the row count, so it's written into a single cell as a compact JSON string instead - useful for round-tripping the data, but not something a spreadsheet will treat as separate values without extra parsing.

Missing or inconsistent fields

Real-world JSON arrays rarely have perfectly uniform objects - one record might be missing a field another one has. The column set is built from every key that appears anywhere in the array, and any object that doesn't have a particular key just gets an empty cell in that column, rather than the column being dropped or the row being skipped.

Practical examples

  • Exporting an array of records pulled from an API into a CSV that a teammate can open directly in a spreadsheet.
  • Turning a JSON list of orders or transactions into a CSV report for accounting or analytics tools that only accept tabular input.
  • Converting test fixture data or a database export from JSON into CSV to share with someone who doesn't work with JSON directly.

What doesn't map cleanly to CSV

  • Types - numbers, booleans, and null all become plain text; a CSV cell can't distinguish the number 42 from the string "42".
  • Deep nesting - a few levels of nested objects flatten reasonably into dot-notation columns, but many levels deep produces long, unwieldy column names.
  • Arrays of objects within a record - a list of simple values fits in one cell as a JSON string, but a list of objects nested inside a single record has no clean tabular equivalent at all.
  • Key order and formatting - CSV has no equivalent of JSON's key ordering or whitespace; only the values themselves carry over.

Frequently asked questions

What JSON shape converts cleanly to CSV?
An array of objects where the objects share a similar set of fields - each object becomes one row, and the union of all their keys becomes the column headers. A single object, or an array of plain values instead of objects, doesn't map naturally to a table and will produce a much less useful result.
What happens to a nested object inside a record?
It's flattened into dot-notation columns - a record like {"address":{"city":"Lahore"}} becomes a column literally named address.city rather than a nested structure, since CSV has no concept of nesting and every column has to be a single flat field.
What happens to an array inside a record, like a list of tags?
It's written into a single cell as a compact JSON string, e.g. ["admin","editor"], rather than being split across multiple columns. This keeps the row count matching the record count, but means that cell isn't plain text - something reading the CSV later may need to parse it back out as JSON.
What happens if some objects have fields that others don't?
Every object in the array is checked for the fields it's missing relative to the full set of columns, and those cells are left empty in that row. No column is dropped just because one record happens to lack it - the column stays, just blank for that row.
Is anything lost when converting JSON to CSV?
Type information is the main thing - numbers, booleans, and null all become plain text in a CSV cell, so a spreadsheet or downstream tool sees "true" or "42" as text unless it's told otherwise. Deeply nested structures also lose their shape once flattened, so very hierarchical JSON is often a poor fit for CSV in the first place.

Related tools