Skip to main content

JSON to CSV Converter

Convert JSON arrays and nested objects to CSV online. Paste or upload JSON, preview the result, then copy or download an Excel-ready CSV file.

Your tool input is processed locally in your browser—not uploaded to or stored by Bitty Coder. Privacy Policy

Input
JSON
0 characters 0 B
Output
CSV

Select Convert to preview the CSV output.

What is a JSON to CSV converter?

A JSON to CSV converter maps structured JSON data into the rows and columns used by spreadsheets, reporting tools, and data import workflows. Objects become rows, properties become column headers, and nested properties are flattened into readable paths such as address.city.

This converter accepts an array of objects, a single object, an object containing a records array, or JSON Lines. It combines fields found across every record, so a field that appears after the first row is not silently discarded.

How to convert JSON to CSV

  1. Paste JSON into the input editor, open a .json, .jsonl, or .txt file, or select Example.
  2. If the document contains several possible record arrays, choose the correct Records path.
  3. Keep the default comma delimiter or open Options to choose semicolon, Tab, header, array, and automatic conversion options.
  4. Select Convert, then inspect the Table or Raw CSV result.
  5. Copy the CSV or open Download to name and save an Excel-ready UTF-8 .csv file.

Inputs up to 1 MB can convert automatically after a short pause. Larger inputs convert only when requested and run in a browser worker. Conversion is disabled above 50 MB so the page does not attempt an unbounded in-memory operation.

JSON array to CSV example

The most common input is an array where each object represents one row:

[
{ "id": 1, "name": "Alice" },
{ "id": 2, "email": "bob@example.com" }
]

The converter builds a stable union of the fields in first-seen order:

id,name,email
1,Alice,
2,,bob@example.com

Missing fields and JSON null values become empty CSV cells.

How nested JSON is converted

Nested objects are flattened with path-based column names:

[
{
"name": "Alice",
"address": {
"city": "London",
"zip": "SW1"
},
"tags": ["developer", "API"]
}
]

The generated columns are name, address.city, address.zip, and tags. Keys that contain dots or other path punctuation use bracket notation so they do not collide with real nested paths.

The default array rules are intentionally predictable:

  • Primitive arrays are joined into one cell, such as developer, API.
  • Object arrays and mixed arrays are stored as compact JSON in one cell.
  • Nested arrays are not expanded into extra rows.

Options can instead stringify every array or use only its first value. CSV is a two-dimensional format, so preserving a complex array in one cell is safer than guessing how many rows the user intended.

Supported JSON structures

StructureBehavior
Array of objectsEach object becomes a CSV row.
Single objectThe object becomes one CSV row.
Object with one records arrayThe object array is selected automatically.
Object with several records arraysA Records path selector asks which array to convert.
Nested objectsProperties become path-based columns.
JSON LinesEach non-empty line must contain one strict JSON object.

A root primitive, primitive array, or mixed root array cannot be treated as a table and produces a clear structure error instead.

JSON vs CSV

FeatureJSONCSV
StructureHierarchical objects and arraysTwo-dimensional rows and columns
Nested valuesSupported directlyMust be flattened or serialized
Data typesStrings, numbers, booleans, null, objects, arraysUsually interpreted as text by import tools
Common useAPIs, configuration, data exchangeSpreadsheets, reports, bulk imports
Typical toolsEditors, API clients, developer toolsExcel, Google Sheets, databases

Use JSON Viewer first when you need to inspect an unfamiliar response and identify which array contains the records.

Use CSV Editor when the converted rows or headers need correction before import.

CSV and Excel compatibility

CSV fields containing the chosen delimiter, quotes, or line breaks are escaped automatically. Quotes inside a field are doubled, and the generated file uses UTF-8 with a byte order mark so Excel can recognize Unicode text more reliably.

Comma is the default delimiter. Semicolon can be useful with regional spreadsheet settings, while Tab works well when text values contain many commas. The copied CSV does not include the byte order mark; it is added only to the downloaded file.

Troubleshooting

Why is my JSON not converting?

The input must be strict JSON or JSON Lines with one strict object per non-empty line. Select an error to move the editor to its line and column. Use JSON Validator when you want to inspect syntax diagnostics separately.

Why do I need to choose a Records path?

A response such as {"users":[...],"orders":[...]} contains more than one possible table. Choose /users or /orders instead of letting the converter guess.

Why is a nested array kept in one cell?

Expanding arrays can duplicate parent values or create a Cartesian product when a record contains several arrays. This converter joins primitive arrays and serializes complex arrays so the original value is preserved without changing the row count.

JSON to CSV FAQ

Can I convert a single JSON object to CSV?

Yes. A single object becomes one row, and its properties become columns.

Does the converter support nested JSON?

Yes. Nested objects use path-based columns, while arrays stay in one cell according to the selected array option.

What happens when records have different fields?

The converter scans all records and adds columns in the order each field first appears. A record without a field receives an empty cell.

Can I convert an API response wrapped in data or results?

Yes. One object-array candidate is selected automatically. When several candidates exist, choose the required JSON Pointer from Records path.

Can I open the downloaded CSV in Excel?

Yes. The download uses a .csv extension, UTF-8 text, and a UTF-8 byte order mark. You can also choose semicolon when required by regional spreadsheet settings.

Does JSON Lines require a separate mode?

No. If standard JSON parsing fails and every non-empty line is a strict JSON object, the converter recognizes JSON Lines automatically.