How to Convert JSON to CSV: A Simple Guide

By Toolinga Editorial Team · Updated · 7 min read

Learning how to convert JSON to CSV is one of those small skills that saves hours of tedious copy-pasting. APIs, webhooks, and modern apps hand you data as JSON, but spreadsheets, accountants, and reporting tools want neat rows and columns. If you have ever opened a JSON file in Excel or Google Sheets and seen a wall of text crammed into a single cell, you know the problem. The good news is that the conversion is simple once you understand what each format is for, and you can do it in your browser.

Why Spreadsheets Want CSV, Not JSON

JSON and CSV were built for different jobs. JSON, short for JavaScript Object Notation, was designed for machines to exchange structured data. A single record can hold text, numbers, lists, and other records nested inside it. That flexibility is why developers love it, and why spreadsheets struggle with it: a spreadsheet is a grid, and every value needs a row and a column.

CSV, or comma-separated values, matches the grid perfectly. The first row names the columns, and every row after that is one record. Excel, Google Sheets, LibreOffice, and almost every database import tool can open a CSV file directly. That is why finance teams ask for CSV exports, why email tools accept CSV contact lists, and why analysts start most projects by turning API responses into CSV.

CSV files are also plain text, so they are small and easy to inspect. An API response often includes fields you do not need, such as internal IDs and metadata, and converting to CSV forces you to choose the columns that matter. If the raw JSON looks like one long unreadable line, run it through a JSON formatter first so you can see its structure.

How to Convert JSON to CSV: What a Clean Conversion Looks Like

A clean conversion follows one simple rule: every JSON object becomes one row, and every field becomes one column. The field names become the header row at the top of the file, and the values line up underneath in the same order. When every record has the same fields, the result is a tidy table that any spreadsheet opens without complaints.

Three details separate a clean CSV from a broken one. First, text containing a comma must be wrapped in double quotes, or your spreadsheet will split it across two columns — a company name like Smith, Jones and Co needs quotes around it. Second, quotes inside text are doubled: she said "hello" becomes "she said ""hello""" in CSV. Third, numbers and dates should keep a consistent format, so amounts always use the same decimal places.

Encoding matters too. If your data includes accented characters or currency symbols, save the CSV as UTF-8. Excel on Windows sometimes misreads UTF-8 files, so if accented names turn into strange symbols, import the file through Excel's Text Import Wizard and choose UTF-8 instead of double-clicking it. Finally, check that every record has the same fields; if one is missing a field, that cell should stay empty rather than shifting later values into the wrong columns.

Nested Data: The Tricky Part of How to Convert JSON to CSV

Flat JSON converts easily, but real API data is rarely flat. A customer record might contain an address object with street, city, and postcode fields, or a list of past orders. A spreadsheet has no way to store an object inside a cell, so nested data must be flattened before it becomes CSV.

The most common approach is dot notation: each nested field becomes its own column, with the path joined by dots. An address object with a city field becomes a column called address.city, and a postcode becomes address.postcode. This keeps every piece of information, and the column names still show where each value came from. It works well when the nesting is only one or two levels deep, which covers most API responses.

Lists are harder, because one record can contain many items. An order with three products cannot fit in a single row without a decision. You have three options: one row per item, repeating the order details, which is best when you need to analyse or add up the items; join the items into one cell, separated by a semicolon, which keeps one row per order but is harder to analyse; or split the data into two files, one for orders and one for items, linked by an order ID. Whatever you choose, apply it to every record — mixing approaches leaves columns meaning different things on different rows.

A Real Example Walkthrough

Suppose you run a small online shop and your ordering system gives you this JSON: an array of four orders, each with a customer name, an email address, and an amount.

  • { "name": "Ana Ruiz", "email": "ana@example.com", "amount": 49.99 }
  • { "name": "Ben Carter", "email": "ben@example.com", "amount": 129.50 }
  • { "name": "Carla Diaz", "email": "carla@example.com", "amount": 24.00 }
  • { "name": "Dan Kim", "email": "dan@example.com", "amount": 89.95 }

This is a clean, flat structure, so the conversion is straightforward. The field names — name, email, and amount — become the header row, and each object becomes one row in the CSV file:

  • name,email,amount
  • Ana Ruiz,ana@example.com,49.99
  • Ben Carter,ben@example.com,129.50
  • Carla Diaz,carla@example.com,24.00
  • Dan Kim,dan@example.com,89.95

Open that file in a spreadsheet and you get a tidy table with four rows and three columns, ready to sort, filter, or total. Add the four amounts — 49.99 plus 129.50 plus 24.00 plus 89.95 — and the total is 293.44, which should match the total in your ordering system. If it does not match, check for a missing or duplicated record.

How to Convert JSON to CSV in Your Browser

You do not need to install software or write code to convert a file. A free online converter does the whole job: paste your JSON, check the preview, and download the CSV. The JSON to CSV converter works entirely in your browser, so your data never leaves your computer, which matters when the file contains customer emails or order details.

The usual workflow takes less than a minute. First, copy the JSON from your API response or export. If it looks like a single compressed line, tidy it first with a JSON formatter so you can confirm the structure is valid. Then paste it into the converter, review the column headers in the preview, and download the CSV. Open the downloaded file in Excel or Google Sheets and check three things: the headers match the fields you expected, no column looks shifted, and the row count matches the number of records in your JSON. If anything looks wrong, the problem is almost always nested data or a missing field.

Frequently Asked Questions

Can I convert JSON to CSV in Excel without an online tool?

Yes. In Excel, use Data, then Get Data, then From File, then From JSON to load the file through Power Query. Power Query shows the JSON as a table you can expand, flattening nested records by clicking the expand icon on a column. Once the table looks right, choose Close and Load, then save the file as CSV. Google Sheets has no built-in JSON import, so for Sheets an online converter is usually faster.

What happens to nested arrays in my JSON?

Nested arrays must be flattened before they become CSV, because a single cell cannot hold a list of values in a useful way. Most converters either create one row per array item, repeating the parent record's fields, or join the items into one cell with a separator. Choose one row per item when you need to count, sum, or filter the items, and a joined cell only when you need one row per parent record.

Why does my CSV look broken when I open it in Excel?

The most common causes are unquoted commas inside text, a different separator, and encoding. If a value contains a comma and is not wrapped in quotes, Excel splits it into extra columns. If your file uses semicolons instead of commas, Excel may put the whole row in one column; importing through the Text Import Wizard and choosing the correct delimiter fixes this. If accented characters look wrong, re-import and choose UTF-8 encoding.

Now you know how to convert JSON to CSV the right way: choose the columns that matter, flatten nested data consistently, watch out for commas and quotes, and verify the row count and a total before you share the file. Try it now with the free JSON to CSV converter — paste your JSON, download a clean spreadsheet-ready CSV, and get back to the work that actually matters.

Related guides

Free Password Generator: Strong Random Passwords

Create strong random passwords in seconds with our free password generator. Learn the right length and generate a secure one now.

November 10, 2026

What Is SHA-256 Hash Used For? A Simple Guide

Learn what is SHA-256 hash used for — passwords, downloads, and blockchains — with a real example and a free hash generator.

November 8, 2026

What Is Unix Timestamp? A Simple Guide

What is Unix timestamp? Learn what those 10-digit numbers mean, how to read them, and how to convert any timestamp to a date.

November 7, 2026

What Is URL Encoding %20? Why It Appears in Links

Wondering what is url encoding %20? Learn why spaces become %20 in links, which characters must be encoded, and how to fix messy…

November 4, 2026