Skip to content
Plaintools

JSON to CSV converter

Paste an array of objects. Nested objects are flattened one level (address.city), arrays and deeper values are serialized as JSON strings, and you can download the CSV. A single object is treated as one row.

Need the reverse? Use the CSV to JSON converter, or convert YAML with the YAML to JSON converter.

JSON to CSV converter example

Two customers with a nested address

[{"name":"Ada","address":{"city":"London"}},{"name":"Alan","address":{"city":"Wilmslow"}}] becomes columns name, address.city.

JSON to CSV converter how-to

  1. Trim and JSON.parse. Root must be a plain object or a non-empty array of plain objects. Scalars in the array are an error.
  2. Flatten each row one level: nested plain objects become `key.child` columns. Arrays and deeper values are JSON.stringify'd into the parent cell. null/undefined → empty string; string/number/boolean → String(value).
  3. Column order: first-seen key across rows.
  4. Escape a field if it contains ", comma, \n, or \r: wrap in double quotes and double internal quotes.
  5. Join columns with commas, rows with \n, then add a trailing newline.

Related tools

Dev

JWT decoder

Read a JWT header and payload, with human timestamps and an expired flag. The token stays in the tab.

Dev

Text diff checker

Compare two texts with a live line and word diff. Optional ignore-whitespace.

Dev

CSV to JSON converter

Convert CSV records to a JSON array of objects with header mapping and type detection.

People also use

Dev

Hash generator

Calculate SHA-256, SHA-384, SHA-512, and SHA-1 checksums for text or local files.

Dev

Timestamp converter

Convert Unix epoch timestamps in seconds or milliseconds to ISO 8601, UTC, and local time.

Dev

Subnet calculator

Calculate IPv4 network address, broadcast, usable range, subnet mask, and host capacity from CIDR.

Dev

CIDR calculator

Calculate IPv4 CIDR blocks, network address, broadcast address, netmask, usable hosts, and wildcard mask.

JSON to CSV converter FAQ

What is a JSON to CSV converter?
A JSON to CSV converter turns hierarchical JSON, such as an API response array of objects, into a flat CSV table for Excel or Google Sheets. Each object becomes a row and each key becomes a column. This one runs locally in your browser, flattening one nested level and keeping arrays and deeper values as JSON strings.
Is my JSON uploaded?
No. Parsing and flattening run in this tab. There is no upload and no API route for your JSON. Disconnect the network first if you need a stronger guarantee.
How do I convert nested JSON to CSV?
Paste your JSON array or object into the converter. Nested objects are flattened one level into dot-notation columns (such as address.city), while arrays and deeper values are serialized as JSON strings. Everything runs locally in your browser—nothing is uploaded.
What JSON shape is accepted?
An array of objects, or one object. A top-level array of scalars is rejected because it has no column names. Invalid JSON shows an error instead of a partial file.
How far do you flatten?
One level. { address: { city: "X", geo: { lat: 1 } } } becomes address.city and address.geo, with the geo value stringified. Deeper automatic flattening is easy to get wrong, so we stop at one hop.
How are commas and quotes escaped?
Fields that contain commas, quotes, or newlines are wrapped in double quotes, and quotes inside a field are doubled. That matches RFC 4180 enough for Excel, Sheets, and most parsers.
I have YAML, not JSON. What should I use?
Convert YAML to JSON on this site first, then bring the JSON here. The YAML tool can also go the other way if you need to round-trip.
How do I convert JSON to CSV the same way?
JSON.parse. Accept one object (one row) or a non-empty array of objects. Flatten one level: nested objects become key.child columns; arrays and deeper values are JSON.stringify’d into the cell. Column order is first-seen. Escape fields that contain quotes, commas, or newlines by wrapping in double quotes and doubling internal quotes. Join with commas and newlines, and end with a trailing newline.