โ† Back to blog
Convert

Convert JSON to CSV (Handles Nested Data)

Convert JSON to CSV online with support for nested data, custom columns, and clean exports. Includes step-by-step examples and mapping guide.

2026-04-014 min readUpdated Apr 30, 2026

Need to export JSON as CSV? Start by choosing the JSON array that should become rows, then map each JSON field to a CSV column.

This guide shows how to transform JSON into CSV online, including nested JSON conversion, column mapping, flattening, and clean spreadsheet exports.

Most conversion tools only work well with flat JSON. Real API data often has nested objects, arrays, optional fields, and inconsistent keys. To get a useful CSV file, you need a workflow that can flatten JSON to CSV, rename columns, and preserve the values your spreadsheet or report needs.

Common use cases include exporting API responses, preparing data for Excel, and building reporting dashboards.

If you're searching for a JSON to CSV converter, a way to convert JSON to CSV online, or a workflow to flatten JSON to CSV, this guide covers the common cases.

Try the JSON to CSV converter now ->

What is JSON to CSV conversion?

JSON to CSV conversion is the process of transforming JSON data into a table format, where each object becomes a row and each field becomes a column in the CSV file.

JSON can contain objects, arrays, nested fields, numbers, booleans, and optional values. CSV is simpler: it stores rows and columns as text. To convert structured JSON cleanly, you need to decide which JSON array becomes the rows and which fields become the CSV columns.

For flat JSON, that conversion can be straightforward. For nested exports, you usually need flattening or custom mappings so values like customer.name become clean columns such as customer_name.

Convert JSON to CSV online (Quick steps)

You can convert JSON to CSV online by pasting JSON into the editor, selecting the conversion utility, choosing columns, and exporting the result as CSV.

  1. Paste your JSON into the editor
  2. Select the JSON to CSV utility
  3. Choose columns or use mappings
  4. Export as CSV

The best input is a JSON array of objects because each object can become one CSV row. If your data is nested, use field mappings or flatten nested JSON before converting to CSV.

You can export and download the final CSV file for use in Excel, Google Sheets, or BI tools.

๐Ÿ’ก Tip

Paste your JSON and use the conversion utility to generate the first export workflow automatically.

Example (Before / After)

Here is a simple nested JSON export example. The JSON contains order rows with nested customer fields.

[
  {
    "id": "ord_1001",
    "customer": {
      "name": "Maya Chen",
      "email": "maya@example.com"
    },
    "total": 89.5,
    "status": "paid"
  },
  {
    "id": "ord_1002",
    "customer": {
      "name": "Jon Smith",
      "email": "jon@example.com"
    },
    "total": 42,
    "status": "pending"
  }
]

After conversion, the CSV has one row per order and clean column names.

id,customer_name,customer_email,total,status
ord_1001,Maya Chen,maya@example.com,89.5,paid
ord_1002,Jon Smith,jon@example.com,42,pending

If you also need to clean JSON before export or normalize ecommerce orders before CSV reporting, the same pipeline approach can help you prepare the JSON before exporting it.

Common Problems When Converting JSON to CSV

JSON can represent nested objects, arrays, optional fields, and deeply structured API responses. CSV cannot. CSV expects rows and columns.

That becomes painful when you need:

  • one row per order, customer, product, or event
  • stable column names
  • flattened nested fields
  • export-ready data for spreadsheets or dashboards

Without a repeatable workflow, CSV export often becomes manual copying, custom scripts, or fragile spreadsheet imports.

Many basic converters will output columns like customer.name, skip nested values, or fail to flatten nested fields correctly. A reliable export workflow should let you choose columns, rename headers, and preserve values from nested JSON without losing context.

How to convert nested JSON to CSV

To convert nested JSON to CSV, map each nested path to a flat CSV column. A tabular export utility turns a JSON array of objects into CSV text and lets you keep all fields, flatten nested fields, choose specific columns, or use custom mappings.

For the order example above, use mappings like this:

{
  "delimiter": ",",
  "includeHeaders": true,
  "arrayDelimiter": "|",
  "mappings": [
    { "columnName": "id", "expression": "{{id}}" },
    { "columnName": "customer_name", "expression": "{{customer.name}}" },
    { "columnName": "customer_email", "expression": "{{customer.email}}" },
    { "columnName": "total", "expression": "{{total}}" },
    { "columnName": "status", "expression": "{{status}}" }
  ]
}

For this example, the workflow produces a short set of useful steps:

  1. Read each object in the JSON array as one row.
  2. Map nested customer fields into top-level CSV columns.
  3. Export the result as CSV.

Result

You end up with:

  • id
  • customer_name
  • customer_email
  • total
  • status

If the generated workflow is too broad, run it again with a tighter prompt or simplify the column list. Smaller export workflows are usually easier to review, explain, and reuse.

For more complex workflows (clean โ†’ transform โ†’ export), you can chain multiple steps into a reusable JSON pipeline.

The pipeline or support material below should show the generated workflow and final CSV output.

This pattern works well for API exports, order reports, product catalogs, customer lists, webhook logs, and analytics prep.

Convert JSON to CSV programmatically

You can also convert JSON to CSV programmatically using scripts or APIs. A developer workflow usually reads a JSON array, selects the fields to export, flattens nested values, and writes each object as a CSV row.

For simple flat JSON, a short script may be enough. For nested JSON, programmatic conversion needs extra rules for paths like customer.email, arrays, missing fields, delimiters, and column names.

Python JSON to CSV scripts and JavaScript JSON to CSV scripts work well for small, predictable data. They often break when the JSON shape changes or when nested fields need custom column names.

While scripts can transform JSON into CSV, they often become harder to maintain with nested data. A visual pipeline is easier to review, adjust, and reuse across exports.

A visual JSON pipeline can help developers prototype the mapping, test the output, and then reuse the same JSON to CSV workflow through an API. See the OpenAPI reference if you need repeatable exports from API responses, webhook payloads, or scheduled data jobs.

JSON to CSV: tools vs scripts

You can convert JSON to CSV using scripts or online tools. Scripts give control but require maintenance. Tools are faster for repeated workflows, especially with nested JSON.

Python and JavaScript scripts are useful when the data shape is stable. Online tools are often better when you need to inspect fields, adjust mappings, or export JSON as CSV repeatedly without editing code.

Limitations of JSON to CSV conversion

JSON to CSV conversion can break down when the input structure does not match a simple table.

Common limitations include:

  • deeply nested arrays may require flattening
  • inconsistent keys can lead to missing columns
  • large files may require streaming or chunking
  • mixed value types can make spreadsheet columns harder to analyze

For very large JSON files, consider streaming or chunked processing before converting to CSV.

For these cases, clean the JSON first, flatten nested fields, or split the export into smaller steps before generating CSV.

Best JSON to CSV converter

Most JSON to CSV tools only support flat data. When working with nested JSON, you need a converter that supports:

  • nested field extraction
  • column mapping
  • flattening
  • reusable workflows

Forge Json is designed for these use cases. It lets you export JSON as CSV online, extract nested fields like customer.email, rename columns, flatten JSON to CSV when needed, and save the workflow for repeated exports.

If your data is already flat, a basic JSON to CSV converter may be enough. If your JSON contains nested customer fields, product data, orders, webhook payloads, or API responses, the workflow gives you more control over the final CSV structure.

Related JSON workflows:

Use the example panel below to open this sample input and run the JSON to CSV workflow directly in the editor.

FAQ

Can I convert JSON to CSV online?

Yes. Paste JSON, configure the JSON to CSV utility, and export CSV text from the browser.

What JSON shape works best for CSV export?

A JSON array of objects is the cleanest input because each object can become one CSV row.

Can nested JSON fields become CSV columns?

Yes. Use flattening for dot-notation columns, or custom mappings when you want column names like customer_name instead of customer.name.

How do I flatten JSON before converting to CSV?

You can either enable flattening or use custom mappings like {{customer.name}} to extract nested fields into columns.

Can I choose specific columns for CSV export?

Yes. Use mappings to define exactly which fields become columns and how they are named.

Support material

Practical example and product context

Use these examples to understand the transformation and apply the same workflow in your own JSON tasks.

Example Transformation

Input
1[
2 {
3 "id": "ord_1001",
4 "customer": {
5 "name": "Maya Chen",
6 "email": "maya@example.com"
7 },
8 "total": 89.5,
9 "status": "paid"
10 },
11 {
12 "id": "ord_1002",
13 "customer": {
14 "name": "Jon Smith",
15 "email": "jon@example.com"
16 },
17 "total": 42,
18 "status": "pending"
19 }
20]
Config
1{
2 "delimiter": ",",
3 "includeHeaders": true,
4 "columns": [],
5 "flattenNested": false,
6 "arrayDelimiter": "|",
7 "mappings": [
8 {
9 "columnName": "id",
10 "expression": "{{id}}"
11 },
12 {
13 "columnName": "customer_name",
14 "expression": "{{customer.name}}"
15 },
16 {
17 "columnName": "customer_email",
18 "expression": "{{customer.email}}"
19 },
20 {
21 "columnName": "total",
22 "expression": "{{total}}"
23 },
24 {
25 "columnName": "status",
26 "expression": "{{status}}"
27 }
28 ]
29}
Why this output looks right
  • Each JSON object becomes one CSV row.
  • Custom mappings rename nested fields into spreadsheet-friendly column names.
  • The output is CSV text that can be opened in Excel, Google Sheets, Airtable, or BI tools.
โ†“
Output
1id,customer_name,customer_email,total,status
2ord_1001,Maya Chen,maya@example.com,89.5,paid
3ord_1002,Jon Smith,jon@example.com,42,pending
Built with Convert utility
Open the sample input and generated pipeline in the editor.
View Utility

Related Articles

Continue with another practical guide in the same workflow area.