AM Jarvis

JSON to CSV Converter (and CSV to JSON) With Nested Data

Turn JSON into a spreadsheet-ready CSV with nested fields flattened, choose how arrays are handled, or convert CSV back to JSON.

Converts in your browser. Your data is never uploaded. Large files (tens of MB) work but the preview shows only the first 100 rows.

In short

Paste JSON or open a .json file and the converter finds the array of records, flattens nested objects into columns such as variants.price, and shows a preview table. Choose how arrays are handled (joined, numbered columns, JSON text or one row per item), pick a delimiter and download the CSV. The CSV to JSON tab does the reverse, with numbers and nested objects rebuilt.

On this page
  1. How to convert JSON to CSV
  2. How nested objects become columns
  3. Four ways to handle arrays
  4. Worked example: orders with line items
  5. Where JSON usually comes from
  6. Delimiter, header and Excel
  7. CSV to JSON
  8. Errors and how to fix them
  9. Other ways to do it, and when they fit better
  10. Limits to know

JSON is how apps and APIs hand over data: product feeds, order exports, form submissions, analytics reports. Spreadsheets want rows and columns. The gap between the two is nesting. A product has variants, each variant has a price and a SKU, and a plain converter either drops those fields or dumps them into one unreadable cell.

This converter flattens nested objects into named columns, gives you four ways to handle arrays, previews the result, and downloads a CSV that opens cleanly in Excel or Google Sheets. It also converts CSV back to JSON. Everything runs in your browser, so API responses with customer data never leave your device.

How to convert JSON to CSV

  1. Paste JSON into the box, click Open .json file, or try Sample: Shopify products.
  2. Check the status line. It says whether the JSON is valid and how many rows it found. If it is not valid, it shows the line and column of the first problem.
  3. Under Rows come from, confirm which array holds your records. The converter picks the largest array of objects automatically, such as products or data.items, and lists the others so you can switch.
  4. Choose how arrays inside a row are handled and pick a delimiter.
  5. Look at the preview of the first 100 rows, then click Download CSV or Copy CSV.

JSON Lines files (one JSON object per line, also called NDJSON, common in log and data exports) are detected automatically. Format JSON pretty-prints what you pasted so it is easier to read.

How nested objects become columns

With Flatten nested objects on, each nested field gets a column named by its path, joined with dots. This record:

{"title": "Linen Throw Blanket", "seo": {"title": "Stonewashed Linen Throw", "description": "Soft European flax linen throw."}}

becomes three columns: title, seo.title and seo.description. Paths can go as deep as the data does, so shipping.address.city works the same way. Columns appear in the order fields are first seen, and a record that lacks a field gets an empty cell. Turn flattening off and nested objects are written as JSON text in a single cell instead.

Records do not need the same fields. API data is often uneven: one order has a discount code, the next does not, a third has a gift note. The converter collects every field from every record, so the CSV has one column for each field that appears anywhere, and the stat boxes show how many columns came from nested paths. If a key already contains a dot, such as "size.us", the column name will look like a path; that only matters if you later convert the CSV back to JSON with nesting turned on, where it would become a nested object. In that case, untick Rebuild nested objects on the CSV to JSON tab.

Four ways to handle arrays

The sample is a Shopify-style products file with two products. Each has tags, an options array and a variants array of objects. Here is what each array setting produces:

SettingResult for the Linen ThrowRows and columns
Join with |tags = linen|bedroom|gift, variants.sku = HL-THR-OAT|HL-THR-SAG, variants.price = 89.00|89.002 rows, 18 columns
Numbered columnstags.0 = linen, tags.1 = bedroom, variants.0.sku = HL-THR-OAT, variants.1.sku = HL-THR-SAG2 rows, one column per item position
JSON texttags = ["linen","bedroom","gift"], variants = the full array as JSON2 rows, few columns
One row per item (variants)Two rows for the throw, one per variant, each with the product title and the variant's sku, price and availability4 rows (2 products × 2 variants)

Join keeps one row per record and works best for short lists like tags. For arrays of objects it joins each field separately, so variants.sku and variants.price line up by position: the second SKU goes with the second price. An empty value keeps its slot, which is why the throw's compare-at prices read 110.00| when only the first variant has one.

One row per item is what most people want for orders with line items or products with variants. Pick the array to expand, and every other field of the record is repeated on each row. Other arrays in the same record are joined. A record whose array is empty still gets one row, so nothing disappears.

Numbered columns suits arrays with a fixed size, such as up to three images. With long, uneven arrays it creates many mostly empty columns.

Worked example: orders with line items

Order exports are the most common reason people need this tool. Take two orders in this shape (shortened):

{"orders": [{"name": "#1041", "email": "dana@example.com", "total": "131.00", "line_items": [{"sku": "HL-THR-OAT", "qty": 1, "price": "89.00"}, {"sku": "HL-TRY-S", "qty": 1, "price": "42.00"}]}, {"name": "#1042", "email": "li@example.com", "total": "18.00", "line_items": [{"sku": "HL-MUG-12", "qty": 1, "price": "18.00"}]}]}

Set arrays to One row per item and choose line_items. The CSV comes out as:

nameemailtotalline_items.skuline_items.qtyline_items.price
#1041dana@example.com131.00HL-THR-OAT189.00
#1041dana@example.com131.00HL-TRY-S142.00
#1042li@example.com18.00HL-MUG-12118.00

Now a pivot table can sum quantity by SKU. Remember that order-level fields repeat on every line, so do not sum the total column in this layout; use the join setting instead when you need one row per order for revenue totals.

Where JSON usually comes from

  • Store and app exports. Many apps offer a JSON download next to CSV, and webhook logs in tools like Zapier or Make show each payload as JSON you can copy.
  • APIs. Responses from REST APIs such as WooCommerce, Stripe or your email platform usually wrap the records in a key like data, items or results. The converter finds that array for you, and a record count in the dropdown confirms you picked the right one.
  • Your own Shopify store. Public Shopify storefronts answer at /products.json with a product list, which is useful for a quick catalog snapshot of your own store in a spreadsheet.
  • Browser developer tools. In the Network tab, a request's response can be copied as JSON and pasted here.

Only convert data you are allowed to use. Customer data from APIs is still personal data once it is in a spreadsheet, so keep the CSV in the same place you would keep the original export.

Delimiter, header and Excel

Comma is the default. Choose semicolon if your Excel uses a comma as the decimal separator, as in much of Europe and Latin America, tab for a TSV file, or pipe for systems that ask for it. The header row can be switched off. UTF-8 BOM is on by default: it adds an invisible marker at the start of the file so Excel shows accented letters, currency symbols and emoji correctly when you double-click the CSV. Google Sheets, Shopify and most other tools ignore it. Untick it only if a system specifically rejects it.

Values are written exactly as they appear in the JSON. Numbers are not reformatted, true and false stay as words, and null becomes an empty cell. Fields that contain the delimiter, quotes or line breaks are quoted the standard way, so a title like Oak Serving Tray, Small stays in one cell. For a native Excel file with a bold, frozen header, convert the CSV with the CSV to Excel converter.

CSV to JSON

Open the CSV to JSON tab, paste CSV or open a file, and the JSON appears as you type. The delimiter is detected, the first row is used as keys, and empty or repeated header names get unique names such as column_3 or price_2.

  • Types: numbers become JSON numbers, true and false become booleans and null becomes null. Values with leading zeros such as ZIP code 02134 stay text, so they are not damaged, and so do numbers longer than 15 digits.
  • Nested objects: headers with dots are rebuilt into objects, so seo.title and seo.description become one seo object. Numbered headers like tags.0 and tags.1 become an array.
  • Output shapes: an array of objects, an array of arrays (header first), or JSON Lines.
  • Indent: 2 spaces, 4 spaces or minified.

The sample turns HL-THR-OAT,Linen Throw Blanket,89.00,14,02134,true into an object with price 89, stock 14, zip "02134" and active true, plus a nested seo object. A value such as 1,5 in a semicolon file stays the text "1,5", because the converter does not guess at decimal commas.

Errors and how to fix them

MessageUsual cause
Extra comma before ] or }A trailing comma after the last item, which JavaScript allows but JSON does not.
Keys need double quotesThe text is a JavaScript object or Python dictionary, not JSON. Replace single quotes with double quotes.
Expected a key in double quotesAn unquoted key such as {sku: "A1"}.
The JSON ends too earlyThe paste was cut off, or a bracket was never closed.
Extra text after the end of the JSONTwo JSON documents pasted together, or log text around the JSON.

Each message comes with the line and column, so in a long file you can jump straight to the problem.

Other ways to do it, and when they fit better

MethodGood forTrade-off
This converterOne-off and weekly conversions, nested data, private dataManual: you paste or open the file each time
Excel Power Query (Data > Get Data > From File > From JSON)A report you refresh from the same file every weekEach nested level has to be expanded by hand in the query editor
Google Sheets with Apps ScriptPulling an API into a sheet on a scheduleYou write and maintain the script
Python (pandas json_normalize) or jqVery large files and automated pipelinesNeeds a developer setup

For most store owners and marketers the answer is simple: if it is a file you get now and then, convert it here; if it is a feed you need every morning, it belongs in a scheduled job or a tool that connects to the source.

Limits to know

  • Files of tens of megabytes work; the preview shows the first 100 rows and the CSV contains all of them. Very large files depend on your device's memory.
  • JSON numbers with more than 15 or 16 significant digits, such as 19-digit IDs from some APIs, lose precision when any browser reads them. If your IDs are that long, ask the API for them as strings.
  • Arrays nested inside arrays (for example option values inside an options array) are kept as JSON text in their cell when joined.
  • Converting a store's products JSON gives you a CSV of that data, not a file in Shopify's product import format, which uses its own column names.

If what you really want is to copy products from a public Shopify or WooCommerce store into your own, with variants, images and prices mapped correctly, the AM Jarvis Product Importer does that directly, and our guide to Shopify CSV imports explains the native format if you prefer to build the file yourself.

Frequently asked questions

How do I convert nested JSON to CSV?

Paste the JSON and keep Flatten nested objects on. Every nested field becomes its own column named by its path, such as customer.email or shipping.address.city. Then choose how arrays are handled: joined into one cell, split into numbered columns, kept as JSON text, or expanded into one row per item.

How do I get one row per line item or variant?

Set Arrays inside a row to One row per item and pick the array, such as line_items or variants. Each item becomes a row, and the parent fields like order number and customer are repeated on every row so the CSV still makes sense when sorted or filtered.

Can I open the CSV in Excel?

Yes. Leave the UTF-8 BOM option on and Excel shows accents and symbols correctly. If your Excel uses commas as decimal separators, choose semicolon as the delimiter. For a real .xlsx file, run the CSV through the CSV to Excel converter.

Is my JSON uploaded anywhere?

No. Parsing, flattening and the CSV are all done by JavaScript in your browser. That matters for API responses and exports that contain customer names, emails or order details, which stay on your device.

Does it support JSON Lines (NDJSON)?

Yes. If the input is not a single JSON document but every line is a JSON object, it is read as JSON Lines and each line becomes a row. The CSV to JSON tab can also write JSON Lines.

Why are my leading zeros kept as text in CSV to JSON?

Values like 02134 or 00123 are usually ZIP codes, SKUs or account numbers, not quantities. Turning them into the number 2134 would destroy them, so they stay strings. Plain numbers such as 42 or 89.00 become JSON numbers when the types option is on.

Can I convert JSON to Excel instead of CSV?

Convert to CSV here first, then open the CSV in the CSV to Excel converter to get a real .xlsx with a bold, frozen header and filters. Excel can also import JSON itself under Data, Get Data, From File, From JSON, but flattening nested arrays there takes more steps.

What is the maximum file size?

There is no fixed limit. Files of several tens of megabytes convert in a few seconds on a recent computer. The preview table shows 100 rows to keep the page fast, while the download includes every row.