Practical guide

Convert nested JSON to CSV without uploading it

CSV is useful when the next step is a spreadsheet, database import, or reporting workflow. The real work is deciding which JSON values become rows, which nested members become columns, and how the receiving application will interpret the resulting text.

JSON All-in-One exports CSV locally from a root array or from a shaped query result. The examples below show the mapping decisions to review before you import the file somewhere else.

Start with the records you want as rows

CSV expects a table. If your source is already an array of similar objects, you can export that array directly. If your records live at data.orders or need filtering, shape that selection first with JQ, then export the result.

This example keeps the edge cases visible: a nested customer object, a missing value, a null value, a comma inside a note, an array cell, an identifier-like amount, and a negative-looking amount.

Source JSON with root wrapperjson
{
  "data": {
    "orders": [
      {
        "order_id": "A-1001",
        "customer": {"name": "Mina Lee", "plan": "pro"},
        "amount": "0012.50",
        "status": "paid",
        "note": "ships, today",
        "tags": ["priority", "gift"]
      },
      {
        "order_id": "A-1002",
        "customer": {"name": "Noah Park", "plan": "free"},
        "amount": "-12",
        "status": null,
        "note": "line one\nline two"
      }
    ]
  }
}
JQ query for the rowsjq
.data.orders
| map({
    order_id,
    customer_name: .customer.name,
    customer_plan: .customer.plan,
    amount,
    status,
    note,
    tags: (.tags // [])
  })
Shaped array to exportjson
[
  {
    "order_id": "A-1001",
    "customer_name": "Mina Lee",
    "customer_plan": "pro",
    "amount": "0012.50",
    "status": "paid",
    "note": "ships, today",
    "tags": ["priority", "gift"]
  },
  {
    "order_id": "A-1002",
    "customer_name": "Noah Park",
    "customer_plan": "free",
    "amount": "-12",
    "status": null,
    "note": "line one\nline two",
    "tags": []
  }
]
Complete wholesale-order workflow: choose one row per line item, build a readable jq projection with autocomplete, calculate line totals, inspect 800 projected rows, and verify the generated six-column CSV preview before download.Watch on YouTube

CSV output shape

The JQ projection turns the nested customer members into deliberate columns such as customer_name and customer_plan. Missing cells are blank. Explicit null is a value, so review how your downstream tool should receive it.

A literal array such as tags becomes compact JSON inside one cell unless you reshape it into separate rows or columns first. That is often the right call for simple reporting, but it is not the same as fully normalizing relational data.

CSV outputcsv
order_id,customer_name,customer_plan,amount,status,note,tags
A-1001,Mina Lee,pro,0012.50,paid,"ships, today","[""priority"",""gift""]"
A-1002,Noah Park,free,"'-12",null,"line one
line two",[]

Export CSV locally

  1. Open the JSON file or response in JSON All-in-One.
  2. Confirm the rows you want are a root array, or use a JQ projection to return the exact row and column shape the receiver needs.
  3. Open Export and choose CSV.
  4. Download the CSV file and import it into the receiving spreadsheet or database with deliberate column types.
  5. Check at least one nested field, one missing field, one null, and one number-like identifier before sharing the file.

Spreadsheet safety changes some cells

CSV is plain text, but spreadsheets may execute or reinterpret cells when they open it. JSON All-in-One's export path can protect formula-like cells by prefixing them with an apostrophe inside the CSV field. That behavior is helpful for values beginning with =, +, @, tabs, or newlines.

The important risk is the minus sign. A text value such as -12 can be treated as formula-like and may be apostrophe-prefixed as "'-12" for spreadsheet safety. If -12 is truly a number, decide whether your import should keep it numeric or preserve source text.

Mapping choices to review

  • Use a JQ projection when you only need a few columns or need a different column order.
  • Literal dots in source keys may need quoted path handling when selecting columns; do not assume a.b always means a nested key.
  • Multiline values can remain inside quoted CSV cells, but not every importer displays them in the same way.
  • CSV output is not native XLSX. If the receiver needs workbook formatting, formulas, or typed columns, CSV is only the data handoff step.
  • Large exports have different costs from viewing or querying a file. Verify the actual export size and route before making performance claims.

When CSV is the wrong target

Choose YAML or TOML for configuration that should keep hierarchy visible. Choose Markdown table for a README table. Choose NDJSON when another tool expects one JSON record per line.

CSV is strongest when rows and columns are the final shape. If you need nested structure later, keep the original JSON next to the export.