1xA2ZOne Data. Any Format.
Live syncLocal-first · no data upload

Convert JSON to CSV

Paste JSON into the Quick paste box and the tool flattens nested objects into columns and writes CSV on the right. It handles table-shaped data only, so each item of the top-level array becomes one row.

Runs entirely in your browser. Your data is never uploaded. Tiếng Việt

01

Spreadsheet

SheetsExcelCSVTSV
✦ Quick pasteSheets / Excel, CSV, TSV, Markdown, JSON, HTML, LaTeX, wiki…
0 rows · 0 columnsSelected cell: A1
02

Live Output

Markdowntwo-way
SyncedEdit directly; the table on the left updates itself
0 characters
Every change is processed right in your browserReady · LocalUTF-8 · by xuanhieu.org

When you need to convert JSON to CSV

This usually comes up when an API response has to open in Excel or load into a system that only takes CSV. The trouble is nesting: CSV is flat and cannot hold an object inside an object. With Flatten nested objects (a.b.c) switched on, customer.name becomes its own column and the items array splits into order.items.0, order.items.1. This page opens with that option on and a UTF-8 BOM added.

How to do it

  1. Paste your JSON into the Quick paste box and press Load into table ↵, or use Import file with a .json file.
  2. Look at the grid: every nested key is a column of its own, with the path joined by dots. Rename headers or delete extra columns right there.
  3. Open ⚙ Options on the CSV tab, pick the delimiter and decide whether to add a BOM.
  4. Press Copy result to paste elsewhere, or Download file to download a .csv.

A real example

The keys customer.name and order.total were two levels deep and are now flat columns. Order A2 has a single item, so order.items.1 and order.items.2 are empty. The column count is the union of keys across every element.

Input · JSON

[
  {
    "id": "A1",
    "customer": {
      "name": "Anna Reed",
      "city": "London"
    },
    "order": {
      "total": 450,
      "items": [
        "book",
        "pen"
      ]
    }
  },
  {
    "id": "A2",
    "customer": {
      "name": "Ben Cole",
      "city": "Leeds"
    },
    "order": {
      "total": 1250,
      "items": [
        "backpack"
      ]
    }
  },
  {
    "id": "A3",
    "customer": {
      "name": "Cara Lin",
      "city": "Bristol"
    },
    "order": {
      "total": 299.5,
      "items": [
        "notebook",
        "pen",
        "ruler"
      ]
    }
  }
]

Result · CSV

id,customer.name,customer.city,order.total,order.items.0,order.items.1,order.items.2
A1,Anna Reed,London,450,book,pen,
A2,Ben Cole,Leeds,1250,backpack,,
A3,Cara Lin,Bristol,299.5,notebook,pen,ruler

Options worth changing

Flatten nested objects (a.b.c)
This is an input option for JSON. Turn it off and nested parts stay as JSON text inside one cell, which suits you when you only need to store the data, not analyse it.
Add UTF-8 BOM
Keep it on when the data has accented text and you open the file in Excel. Turn it off for a system that treats the BOM as part of the first column name.
Delimiter
Pick semicolon if your Excel piles everything into one column when you open a comma CSV.
Formula guard
Use it when JSON values may start with =, +, - or @. The tool puts an apostrophe in front, so the exported value differs from the original.

Common problems

Limits

Frequently asked questions

What happens to arrays when I go from JSON to CSV?

Each array item gets its own column with a numeric suffix, such as order.items.0 and order.items.1. Elements with fewer items leave the later columns empty.

My JSON is an object wrapped around an array. Does it work?

Yes. An object with a single key holding an array of objects is read as that array. An object whose values are arrays is read with one column per key.

Can I turn the CSV back into nested JSON?

Not automatically. A column called a.b.c returns as a flat key, not as nested objects. If you need the nesting back, rebuild it in code.

Does my API data go to a server?

No. The JSON is read and converted in your browser, and the page does not upload it.

Why do the column names contain dots?

That is path notation: customer.name means the key name inside the object customer. Rename the column in the grid if you want something shorter.

Related conversions

1xA2Z · Guide

Table statistics