PrettifyPrettify

JSON to CSV Converter

Turn a JSON array of objects into CSV that a spreadsheet can open. Prettify writes one row per object, builds the header from the keys, and quotes each field that needs it. The conversion runs in your browser. Copy the CSV, download it, or open it in the Table view.

CSV
The converted result shows here as you paste.
Runs in your browser. Nothing is uploaded.

How a JSON array becomes a table

CSV is flat, so the best input is an array of objects. Each object becomes a row. The header lists the keys of all the objects, in the order Prettify first meets them. A key that shows up only in a later object still gets a column.

A key that an object lacks leaves a blank cell. A value of null also gives a blank cell. Keys that are whole numbers, such as "2024", move to the front of the header.

Key features

The converter writes standard CSV that Excel, Numbers, Google Sheets, and import tools can read. These details decide what the file looks like and how a spreadsheet reads it.

  • A field with a comma, a quote, or a line break is wrapped in quotes, and a quote inside it is doubled.
  • Rows end with CRLF line breaks, and the file has no break after the last row.
  • Numbers and booleans are written as plain text, such as 5 and true.
  • An array of plain values, such as [1, 2, 3], becomes one column with no header.
  • A single object is wrapped into a one-row table, and the panel warns you.
  • The delimiter is always a comma. The Convert step has no setting for another one.

How to convert JSON to CSV

Start in the box at the top of this page. It reads documents up to 512 KB. The box shows the CSV as text. The sortable table is in the editor, one step later.

  1. Paste your JSON into the box labeled "Paste your JSON", or select "Try an example".
  2. Read the CSV in the result panel. The warning under the summary tells you about nested values and rounded numbers.
  3. Select Copy to put the CSV on the clipboard, or select Download to save it as prettify.csv.
  4. Select "Open in full editor". The editor opens at /app/editor with the CSV in the Table view.
  5. Sort and filter the rows in the Table view, or switch to the Raw view to see the text.
  6. For a larger file, open the JSON in the editor, select Convert in the Transform group of the toolbar, and pick CSV.

Worked example: a customer list

The JSON below lists three customers. The second has an extra referrer key. The third has a null plan, a list of tags, and a nested address. The block after it is the CSV that Prettify produces.

The header holds every key from all three objects. The name "Ruiz, Ana" is quoted because of its comma. The quotes in Lee "LP" Park are doubled. The null plan and the missing referrer values are blank cells.

The tags list stays in one cell as JSON text, so its quotes are doubled. The address object becomes its own column, address.city, and the panel names that change. Each row ends with a CRLF break.

[
  {"id": 101, "name": "Ruiz, Ana", "plan": "pro", "seats": 5},
  {"id": 102, "name": "Lee \"LP\" Park", "plan": "free", "seats": 1, "referrer": "ana@example.com"},
  {"id": 103, "name": "Sam", "plan": null, "seats": 2, "tags": ["beta", "early"], "address": {"city": "Austin"}}
]

id,name,plan,seats,referrer,tags,address.city
101,"Ruiz, Ana",pro,5,,,
102,"Lee ""LP"" Park",free,1,ana@example.com,,
103,Sam,,2,,"[""beta"",""early""]",Austin

Common use cases

Developers hold data as JSON, and many other people work in spreadsheets. This page connects the two, and it needs no code. These are common jobs for it.

  • Export a list from an API response for a spreadsheet or a report.
  • Give a teammate who does not read JSON a sheet that opens in Excel.
  • Prepare records for a database or CRM import that takes CSV.
  • Find inconsistent records, because a blank cell shows a key that some objects lack.
  • Run SQL over the result in the editor. SQL is a Pro feature.

Nested values and rounded numbers

A cell holds one flat value, so Prettify spreads a nested object across columns. The key address with a city inside becomes the column address.city, which you can sort and filter in a spreadsheet. An array stays in one cell as JSON text, such as ["beta","early"], so no item is lost. The panel names both changes.

Converting the CSV back to JSON keeps address.city as one key. It does not rebuild the nested object. A number past 9007199254740991 is rounded, and 4.0 is written as 4. A warning names this too. Store a long ID as a string to keep every digit.

Frequently asked questions

My JSON is {"data": [ ... ]}. Why is there one row?

Prettify does not look inside the object for an array. It wraps the whole object as one row, and the data column holds the array as JSON text. Copy the inner array to the top level, and the rows appear.

Will Excel run a value that starts with = as a formula?

No. A text value that starts with =, +, -, or @ gets a leading single quote, so the spreadsheet shows it as text. The panel tells you how many cells changed. Plain numbers such as -5 do not change.

Does my data leave my device?

No. Parsing and writing the CSV both run in your browser tab. A customer export or an analytics dump is not uploaded. Only a share link, which you create on purpose, sends data.

Which line ending does the CSV use?

Rows are separated by CRLF, the usual CSV line ending. A value with a line break inside quotes keeps its own line feed.

Can I turn the CSV back into JSON?

Yes. Use the CSV to JSON page. Every value returns as text, so 5 comes back as "5" and true as "true". Blank cells come back as empty strings, not null.

Related tools