Skip to content
Server-sideDeleted in 30 minutes

Convert JSON to CSV

Convert a JSON array of objects into a spreadsheet-friendly CSV, keeping the payload. The converter builds a union of keys across all records, keeps the first-seen field order, quotes commas and line breaks correctly, and serializes nested arrays or objects as JSON text inside a cell. It is designed for API responses, fixtures, exports, and quick inspection. A flat array of records is required because CSV has rows and columns but no native representation for an arbitrary JSON tree.

Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.

Add to Chrome — free
Input
CSV

What it does

  • Top-level array-of-objects validation
  • Union of fields across uneven records
  • Nested values retained as JSON cells
  • Correct CSV quoting for commas and line breaks
  • Copy to clipboard or download as a file

How to use JSON to CSV

  1. 1

    Paste an array of objects

    Provide JSON whose top level is an array, with one object for each desired CSV row. The tool rejects nested arrays as the top-level shape because no row rule would be unambiguous.

  2. 2

    Check the columns

    The header row contains every key found from left to right as the records are read. Fields missing from one object become empty cells in that record.

  3. 3

    Inspect nested cells

    Arrays and objects are written as compact JSON strings in their cell. Review those cells before opening the file in a spreadsheet that may display them as long text.

  4. 4

    Download the CSV

    Copy the result for a quick paste or download it as a CSV file. Validate required headers and types in the destination system before a bulk import.

How it works

Choose a stable row shape

CSV is tabular, so nested objects and arrays need a deliberate representation before they can become columns. Check whether every object has the same keys, how missing values should appear, and whether commas, quotes, or line breaks occur inside strings. Open the result in the actual spreadsheet or import tool that will consume it. The converter can serialize a useful table, but it cannot infer the business meaning of nested data or recover fields that were never present in the source.

The tool parses the document with the browser's JSON parser, then walks the array in order. Every object key is added to a header list only the first time it appears. This produces stable, readable columns without sorting away the source's familiar order. Each row looks up every header, uses an empty value when the property is missing, and converts primitive values to their string form. Null and undefined-like missing values become empty cells.

When a property contains an object or array, its JSON representation is placed in a cell and the CSV writer applies RFC-style quoting. A comma, quote, carriage return, or line feed inside a value cannot shift the following columns. The converter does not evaluate expressions, execute JSON values, fetch links, or infer a database schema.

When to use it

Use this for an API export, a JSON fixture that needs spreadsheet review, a support report, or a small handoff to someone who works in Excel or Google Sheets. For a large stream or a strict data warehouse load, use a schema-aware pipeline and test encoding, date handling, number precision, and required columns there. CSV is a convenient interchange format, not a lossless replacement for nested JSON.

Examples

Exporting API records for a spreadsheet

[{"id":1,"name":"Ada"},{"id":2,"name":"Grace"}]
id,name 1,Ada 2,Grace

Each object becomes one row and the two shared keys become columns. The numeric IDs are rendered as text in CSV because CSV consumers decide their own types.

Keeping an array inside a cell

[{"name":"Ada","skills":["math","programming"]},{"name":"Linus"}]
name,skills Ada,"[""math"",""programming""]" Linus,

The nested skills array is not flattened into invented columns. It is encoded as JSON text and quoted for CSV, preserving the information without pretending that a universal one-to-many spreadsheet layout exists.

Frequently asked questions

What JSON shape does JSON to CSV accept?

It accepts a top-level array in which every item is a non-null object. That shape supplies a clear rule: one object is one row and one property is one column. A top-level object, array of arrays, scalar, or mixed collection is rejected because each would require a different and potentially destructive interpretation.

What happens when different JSON objects have different keys?

The output header contains the union of keys across all objects, in first-seen order. A record that does not contain a particular key receives an empty cell. This keeps later fields from disappearing, but you should still compare the resulting headers with the schema expected by your spreadsheet or import tool.

Are nested arrays and objects flattened into columns?

No. They are serialized as JSON text in one quoted CSV cell. Flattening would require application-specific choices about repeated values and nested paths, and could lose relationships. If a database import needs one row per nested item, reshape that relationship deliberately instead of relying on a generic exporter.

Does the conversion upload my JSON?

No. JSON parsing, field discovery, quoting, and CSV serialization happen locally in the browser. Nothing is sent to a server by this tool. Treat the downloaded CSV as sensitive if the source contains customer records, credentials, or private identifiers, because local processing does not change your own handling duties.