JSON to CSV converter

Paste JSON or open a file and get CSV back: you pick the list that becomes the rows, and nested objects become dotted columns. Nothing is uploaded.

Example JSON: paste your own over it, or open a file

CSV

3 rows and 8 columns, from data.results. 1 cell starts with =, +, - or @ and is prefixed with an apostrophe ('), so a spreadsheet shows it as text.

JSON from an API? The YouTube Search API returns its results as a list you can paste straight in.

Free, no sign-up. It runs in your browser: what you type is not sent anywhere.

Checked on 2026-11-24.

How to convert JSON to CSV

Paste your JSON into the box, drop a .json file on it, or open one with the file button. The CSV appears underneath at once, with a line saying how many rows and columns it has and which list they came from. Copy it, or download it as a .csv file named after the file you opened.

JSON from an API rarely starts with the list you want. An answer such as {"data": {"results": [...]}} holds the rows one or two levels down, next to other fields. The converter looks for every list of objects in the document and starts with the longest one; the Rows from menu lets you pick another, or turn the whole object into a single row. The swap button feeds the CSV back in and converts it to JSON again, which is a quick way to check the result.

The converter also reads JSON Lines: one JSON value on each line, with no list around them.

How the columns are made

  • One row per object. Each object in the list becomes a row. The columns are every name that appears in any of the objects, in the order they first appear, so an object that lacks a field gets an empty cell rather than shifting the others. In the example, only the third lamp has a rating, and the column is still there for all three.
  • Nested objects become dotted names. {"price": {"amount": 24.5}} becomes a column price.amount, at any depth.
  • Arrays, your choice. A list of plain values in a cell is joined with a semicolon and a space (led; dimmable), kept as JSON text (["led","dimmable"]), or spread over one column per item (tags.0, tags.1). A list of objects is kept as JSON when you choose joined, since there is no plain way to join objects; with one column per item, each object is flattened too (items.0.name).
  • Values. null and empty objects and lists become empty cells; true and false stay words. Numbers are written with the digits they have in the JSON, so 24.50 stays 24.50, where your browser gives the reader a number's original text (the context.source of JSON.parse(), on MDN).

The CSV it writes

The converter writes CSV as RFC 4180 describes it, an Informational memo from October 2005 that also registers the text/csv media type. Each record ends with a line break written as CRLF, the first line holds the column names, and fields are separated by commas. A field that contains a line break, a double quote or a comma is enclosed in double quotes, and a double quote inside it is written twice: Clip lamp "Mini" becomes "Clip lamp ""Mini""". Other fields are written as they are; the RFC adds that "Spaces are considered part of a field and should not be ignored", so none are trimmed.

The RFC describes commas only. If the file is going somewhere that expects semicolons, tabs or pipes, choose that separator; the quoting rules stay the same, with that character in place of the comma. The copy and the download keep the CRLF line endings the RFC asks for, though the box on the page shows them as plain line breaks.

Text that starts with =, +, - or @

A CSV file is plain text, but a spreadsheet that opens one may read a cell as a formula. OWASP's page on CSV injection says that when a program such as Microsoft Excel or LibreOffice Calc opens a CSV, "any cells starting with = will be interpreted by the software as a formula", and lists the starting characters to watch: =, +, -, @, a tab, a carriage return and a line feed, and the full-width forms of the first four that some locales also read as formulas. The same page lists what such a cell can be used for when the data comes from strangers: attacking a weakness in the spreadsheet program, tricking someone who clicks through its security warnings, and sending data out of the open spreadsheet.

OWASP's advice is to enclose such a field in double quotes, start it with an apostrophe and double any quote inside it. That is what the converter does by default, and the summary line says how many cells it changed. The same page warns that this is not reliable in Microsoft Excel after the file is saved and opened again, and offers a tab at the start of the field instead, noting that the tab then stays in the data. Both are in the menu, and so is turning it off, which you want when the CSV goes into a program rather than a spreadsheet. Only text from the JSON is changed: a JSON number such as -12.5, or true, cannot hold a formula and is written as it is.

Opening the file in Excel

The CSV is UTF-8. Microsoft's page Opening CSV UTF-8 files correctly in Excel says Excel opens such a file normally "if it was saved with BOM (Byte Order Mark)". Choose Yes under Byte-order mark and the downloaded file starts with one. Leave it off unless the file is for Excel: the mark is an invisible character at the very start of the file, in front of the first column's name. The same Microsoft page also shows how to open a file without the mark: from the Data tab, Get Data, then the text/CSV option under From File.

Where it stops

  • Very long numbers. RFC 8259, the JSON standard, says integers in the range [-(2**53)+1, (2**53)-1] are the ones implementations "will agree exactly on". Longer ones, such as 19-digit ids, are written exactly when your browser passes the original digits to the reader; when it does not, the summary says how many numbers to check.
  • Repeated names. RFC 8259 says the names in an object "SHOULD be unique". When one is repeated, the converter, like the browser's own JSON reader, keeps the last value.
  • Names with dots. A field named price.amount and a nested price object with an amount end up in the same column, and the later value wins.
  • Lists inside lists. The Rows from menu offers lists of objects that are not inside another list. A list inside each row stays in that row's cells, joined, as JSON or one column per item.
  • Size. It opens files up to 25 MB. Everything happens in the page, so a very large file takes a moment.

Get the data automatically

If the JSON comes from an API, you can write the CSV in the same script. The YouTube search endpoint returns its results under data.results, each with a title, url, viewCount, publishedAt and a nested channel object. Python's csv module writes CSV with CRLF line endings and quotes only fields that need it, as this page does; its documentation asks for the file to be opened with newline=''.

Python
import csv
import os
import requests

res = requests.get(
    "https://pipefetch.com/v1/youtube/search",
    params={"q": "web scraping tutorial", "limit": 20},
    headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
    timeout=90,
)
if res.status_code == 404:
    print("No results")  # not charged
else:
    res.raise_for_status()
    results = res.json()["data"]["results"]
    with open("search.csv", "w", newline="", encoding="utf-8") as f:
        writer = csv.writer(f)
        writer.writerow(["title", "url", "viewCount", "publishedAt", "channel.name"])
        for r in results:
            writer.writerow([r["title"], r["url"], r["viewCount"], r["publishedAt"], r["channel"]["name"]])

A search costs 1 credit and returns up to 40 results, 20 by default. A search with no results answers 404 and costs nothing. Titles come from strangers, so if the file is for a spreadsheet, apply the same apostrophe rule as above before writing them.

Questions

How do I convert a JSON API response to CSV?

Paste the whole response. The converter finds the lists of objects in it, such as data.results, and turns the longest into rows; pick another one under Rows from if you need it. Other fields of the response, like a page number, are left out unless you choose the whole object as one row.

What happens to nested objects?

They become columns with dotted names: {"price": {"amount": 24.5}} becomes a column price.amount. Arrays are joined, kept as JSON, or spread over numbered columns, as you choose.

Why does a cell start with an apostrophe?

Because its text started with =, +, - or @, which a spreadsheet may run as a formula. OWASP recommends the apostrophe for data from untrusted sources. Turn it off in the menu if the CSV is for a program rather than a spreadsheet.

Why are accented letters wrong when I open the CSV in Excel?

The file is UTF-8, and Microsoft says Excel opens a UTF-8 CSV file normally if it was saved with a byte-order mark. Choose Yes under Byte-order mark and download the file again.

Can it turn the CSV back into JSON?

Yes. Press the swap button, or switch the menu to CSV to JSON. With nested objects turned on there, dotted column names become nested objects again.

Does this tool upload my JSON?

No. The conversion runs in your browser: what you paste, and any file you open, is read by the page itself and is not sent anywhere. The file you download is made on your computer.

Need this for many accounts, or in your code? The Pipefetch API returns the data as JSON, one GET request at a time. Get an API key with 100 free credits, no card needed.

APIs that return this data

Guides

Similar tools

More free tools

All free tools