JSONGenerator
GeneratorSchemaConvertersExamplesDocs

JSONGenerator

Free online tools for generating random JSON data and JSON Schemas.

Quick Links

  • JSON Generator
  • JSON Schema Converter
  • Examples
  • Docs
  • Blog
  • About
  • Contact
  • Privacy Policy

Converters

  • JSON to YAML
  • YAML to JSON
  • XML to JSON
  • JSON to XML
  • JSON to TOML
  • TOML to JSON
  • JSON to CSV
  • CSV to JSON
  • JSON to Excel
  • Excel to JSON
  • JSON to HTML table
  • JSON to TypeScript
  • JSON to C#
  • JSON to Go
  • JSON to Java
  • JSON to SQL

Support

Having issues? Contact us.

© 2026 JSON Generator. All rights reserved.

JSON to CSV Converter

Paste a JSON array and convert it to CSV online, with nested objects flattened into columns.

Swap directionSwap direction

JSON Input

Paste JSON, upload a .json file or drop one here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  "meta": { "total": 3, "page": 1 },
  "data": {
    "users": [
      {
        "id": 1,
        "name": "Ada Lovelace",
        "email": "ada@example.com",
        "address": { "city": "London", "country": "UK" },
        "roles": ["admin", "editor"],
        "bio": "Wrote the first \"program\", in 1843."
      },
      {
        "id": 2,
        "name": "Zoë Müller",
        "email": "zoe@example.com",
        "address": { "city": "Zürich", "country": "CH" },
        "roles": ["viewer"],
        "active": true
      },
      {
        "id": 3,
        "name": "Linus T.",
        "address": null,
        "roles": [],
        "bio": "Line one\nLine two"
      }
    ]
  }
}

CSV Output

Updates as you type. Copy it or download data.csv.

1

Converting…

Convert JSON to CSV online

This free JSON to CSV converter turns a JSON array of objects into a table you can open in Excel, Google Sheets or Numbers, or load into a database. Paste an API response or a database export, and the CSV appears as you type: one row per object, one column per key. There is nothing to install and no sign-up, and because the conversion runs in your browser, your JSON is never uploaded.

Real JSON is rarely flat, so the converter handles the messy parts. It flattens nested objects into columns, fills gaps when objects have different keys, and quotes every field that contains a comma, a double quote or a line break. You can paste a bare array, a single object, or a response wrapped in {"data": [...]}, and it finds the rows for you.

How to convert JSON to CSV

  1. Paste your JSON into the JSON Input editor, or click the upload button to open a .json file. You can also drag a file onto the editor.
  2. The CSV Output updates as you type. If the JSON is invalid, or has no rows to convert, the status bar tells you what is wrong.
  3. Choose a delimiter (comma, semicolon or tab), and decide whether to flatten nested objects into separate columns.
  4. Click Copy to put the CSV on your clipboard, or Download to save it as data.csv. Tick UTF-8 BOM for Excel first if the file has accented or non-Latin characters and will be opened in Excel.

JSON to CSV example

The second record has no bio and the first has no active, so both columns exist but some cells are empty. The nested address object becomes two columns, the roles arrays stay in one cell each, and the quotes inside the bio are doubled, which is how CSV escapes them.

JSON input
[
  {
    "id": 1,
    "name": "Ada Lovelace",
    "address": { "city": "London", "country": "UK" },
    "roles": ["admin", "editor"],
    "bio": "Wrote the first \"program\", in 1843."
  },
  {
    "id": 2,
    "name": "Zoë Müller",
    "address": { "city": "Zürich", "country": "CH" },
    "roles": ["viewer"],
    "active": true
  }
]
CSV output
id,name,address.city,address.country,roles,bio,active
1,Ada Lovelace,London,UK,"[""admin"",""editor""]","Wrote the first ""program"", in 1843.",
2,Zoë Müller,Zürich,CH,"[""viewer""]",,true

How the JSON to CSV conversion works

How JSON values are written as CSV cells
JSONCSV resultNotes
Array of objectsOne row per objectColumn order follows the first time each key appears.
Single objectOne rowWrap it in [ ] to keep it as one row even if it contains arrays of objects.
Nested objectColumns like address.cityWith flattening off, the object is written as JSON text in one cell.
ArrayJSON text in one cellFor example ["a","b"], whatever the array contains.
nullEmpty cellA missing key also gives an empty cell.
Number, true, falseWritten as textNumbers use JavaScript formatting, so 1.50 becomes 1.5.
StringUnchangedQuoted only if it contains the delimiter, a double quote or a line break, or has leading or trailing spaces.

Nested JSON to CSV

CSV has no nesting, so nested JSON has to be spread across columns or squeezed into one cell. With Flatten nested objects on, every level joins its parent key with a dot: {"address": {"geo": {"lat": 59.9}}} becomes a column named address.geo.lat. Turn it off and the whole address object is written as a JSON string instead, which is useful when another system will parse that cell again.

Arrays are never expanded, because there is no single right answer: one row per element, or one column per index. Instead each array is written as compact JSON text such as ["admin","editor"]. That is lossless and consistent for arrays of strings, numbers and objects alike. If you want one row per element, for example one row per order, paste the array of orders itself.

Which array becomes the rows?

A top-level array is the table. If you paste an object, the converter searches it depth first, in key order, for the first non-empty array that contains only objects, and uses that one. So {"meta": {...}, "data": {"users": [...]}} converts the users, and the meta fields are left out. An object with no such array becomes a single row. A JSON array of plain values, like ["a", "b"], becomes a single value column.

Quoting, delimiters and line breaks

The output follows the usual CSV rules. A field containing the delimiter, a double quote or a line break is wrapped in double quotes, and any double quote inside it is doubled. Line breaks inside values are kept, so a multi-line string stays one cell. Rows end with a line feed, which Excel, Google Sheets and any CSV parser accept. If a value contains a semicolon, it is quoted when the semicolon delimiter is selected and left alone otherwise.

What CSV cannot keep

CSV is plain text with no data types. After conversion, the number 7, the string "7" and the boolean true are just characters in a cell, and an empty cell can mean null, an empty string or a key that was never there. If you need to tell those apart later, keep the original JSON, or turn flattening off and parse the JSON text in those cells downstream. Numbers beyond JavaScript's safe integer range (about 9 quadrillion) are rounded when the JSON is parsed, so write very large IDs as strings in the source.

Opening the CSV in Excel

Two things trip people up. First, the delimiter: in locales where the comma is the decimal mark, Excel treats the semicolon as the list separator, so a comma-separated file opens as one long column. Pick Semicolon for those regions. Second, the encoding: the CSV is UTF-8, but Excel does not reliably detect that on double-click, so characters like ü or é can come out garbled. Either tick UTF-8 BOM for Excel (it adds a byte order mark to the downloaded file only) or import with Data > From Text/CSV and choose UTF-8. Skip the BOM when the file is going to a script or database loader, since some parsers read the mark as part of the first column name.

Excel also guesses types on import. Values such as 00123 lose their leading zeros and very long numbers turn into scientific notation. The CSV itself is correct; to keep the text, import through Data > From Text/CSV and set those columns to Text. If you would rather skip CSV, the JSON to Excel converter writes a real .xlsx file.

Why convert JSON to CSV?

  • Analysis in spreadsheets: Sort, filter and pivot an API response in Excel or Google Sheets without writing code.
  • Sharing data with non-developers: Analysts, support and finance teams can open a CSV directly, while raw JSON means nothing to most of them.
  • Database and BI imports: PostgreSQL's COPY, MySQL's LOAD DATA and most reporting tools import CSV out of the box.
  • Bulk uploads: CRMs, e-commerce platforms and marketing tools often accept customer or product lists only as CSV.
  • Quick reports from logs and exports: Turn a JSON export from a monitoring or admin tool into rows you can scan and attach to a ticket.

The same steps work for a plain JSON array to CSV conversion and for a messy one. Records with different keys, missing fields and mixed nesting all end up in one table, so you can compare them side by side before deciding which columns you actually need. Because everything happens as you type, it is easy to experiment: switch the delimiter, toggle flattening and watch the header row change.

Need test data first? Create realistic records with the JSON Generator and convert them here. To go the other way, use the CSV to JSON converter. If you want typed tables rather than a file, try JSON to SQL to generate a CREATE TABLE statement and INSERT rows, or JSON to HTML table for a table you can paste into a page. And when you are not sure what shape your data has, the JSON Schema Generator shows its structure.

Frequently Asked Questions

How do I convert JSON to CSV?

Paste your JSON into the JSON Input editor, or upload a .json file. The CSV appears in the output editor as you type. Copy it, or click Download to save it as data.csv and open it in Excel or Google Sheets.

How do I convert nested JSON to CSV?

Leave Flatten nested objects ticked. Each nested object becomes dot-notation columns such as address.city, however deep it goes. Arrays are written into a single cell as JSON text, for example ["admin","editor"].

Can I convert a single JSON object or an API response with a wrapper?

Yes. A single object becomes one row. If the object contains an array of objects, such as {"data":{"users":[...]}}, the converter uses the first one it finds as the table. To force an object to be a single row anyway, wrap it in square brackets.

Why does my CSV open in one column in Excel?

In regions where the decimal separator is a comma, such as Germany, France and the Netherlands, Excel expects a semicolon between fields. Choose Semicolon in the Delimiter option and download again. You can also use Excel's Data > From Text/CSV import and pick the delimiter there.

Why do accented characters look wrong when I open the CSV in Excel?

The file is UTF-8, and Excel does not always detect that when you double-click a CSV. Tick UTF-8 BOM for Excel before downloading, or import it with Data > From Text/CSV and select UTF-8 as the file origin.

Can I convert CSV back to JSON?

Yes. Use the CSV to JSON converter, or click Swap direction above the editors. Nested objects you flattened will come back as flat keys such as address.city, because CSV has no way to mark nesting.

Is my JSON uploaded to a server?

No. The conversion runs entirely in your browser with JavaScript, so your data never leaves your device. That makes it safe for exports that contain customer or internal data.

Related converters

  • CSV to JSON ConverterConvert CSV with a header row to a JSON array of objects, with numbers and booleans typed.
  • JSON to Excel ConverterConvert JSON to an Excel .xlsx spreadsheet you can open in Excel, Numbers or Google Sheets.
  • Excel to JSON ConverterConvert an Excel .xlsx, .xls or .ods sheet, or pasted cells, to JSON.
  • JSON to HTML Table ConverterConvert a JSON array to an HTML table you can paste into a page or email.
  • JSON to YAML ConverterConvert JSON to clean, readable YAML for config files, Kubernetes and CI pipelines.
  • YAML to JSON ConverterConvert YAML, including anchors and multi-document files, to formatted JSON.

See all JSON converters