Skip to content
brownie.tools

JSON to CSV Converter

Select nested JSON records, preview columns, and export CSV with your chosen headers and separator.

Conversion options

Arrays stay as JSON. Formula protection prefixes risky text cells and headers with an apostrophe; disable it for unchanged text.

Runs locally in your browser. Nothing is uploaded or sent to a server.

Paste records into JSON / JSONL input to get CSV output automatically, then select Download CSV to save data.csv. Open a local JSON or JSONL file instead if needed. Select a nested record array with Root record path, preview the first 20 rows, and include, rename, or reorder columns. Nested objects flatten into dotted headers; arrays remain JSON cells. Choose comma, semicolon, tab, or pipe separators, with formula protection enabled by default and an optional UTF-8 BOM.

Updated

How Do You Convert JSON Records into CSV?

Paste a JSON array of objects into JSON / JSONL input, or use Open JSON / JSONL file to read a local export. Each object becomes one CSV row. Conversion updates as you edit the input or change an option; there is no separate submit step. Select Download CSV when the output is ready.

For a reproducible example, leave the default comma separator, flattening, and formula protection enabled, and paste these two records:

[
  {"name":"Ava, Lee","profile":{"city":"Leeds"},"tags":["editor","reviewer"]},
  {"name":"Sam","profile":{"city":"Bath"},"active":true}
]

The result has two data rows and four columns. The header row is additional to the reported row count. The exact CSV text is:

name,profile.city,tags,active
"Ava, Lee",Leeds,"[""editor"",""reviewer""]",
Sam,Bath,,true

The comma in Ava's name requires quotes. The tags array becomes JSON text inside a quoted CSV cell, with its double quotes doubled. The trailing comma on the first data row represents a missing active value; the adjacent commas on the second represent missing tags. Downloaded records use CRLF separators even though this example displays as ordinary lines.

The converter discovers columns across the entire dataset. Here, active first appears in the second record and still becomes a column. Missing cells stay empty. Column order follows the first occurrence of each field, rather than sorting alphabetically. The Sample button loads another nested dataset with differing fields so you can explore these settings without preparing a file.

How Do You Select Nested Records and Customize Columns?

API exports often wrap records inside an object. With {"data":{"items":[{"id":7},{"id":8}]}}, choose data.items under Root record path to export the two objects as rows. The picker lists discovered nonempty arrays containing only objects, with their record counts. It does not automatically merge separate arrays or join parent metadata into each selected record.

Use Columns and preview to deselect unwanted fields, edit each Output name, and arrange fields with Move up or Move down. These controls change the CSV headers and order without editing the JSON. After customizing columns, included output names must be nonempty and distinct; selecting no columns produces an error.

The table shows the first 20 source records in selected column order, while CSV output contains all converted records. Source preview is not the final escaped CSV: check CSV output to see quoting and formula protection. Editing the input, opening another file, changing format, or toggling flattening resets column customization and the selected record path, so choose the source and structure before arranging headers.

How Are Nested Fields Represented Without Losing Their Values?

With flattening enabled, nested objects produce dotted column names such as profile.city. A literal dot in an original key is escaped as \., and a literal backslash is doubled. This distinguishes a key named profile.city from a city field inside a profile object. Consumers reconstructing paths must account for those escapes.

Arrays remain JSON text in a single cell, preserving their structure instead of joining elements into an ambiguous comma-separated string. Empty objects also remain JSON text. Turning flattening off keeps nested objects in JSON cells as well. The CSV quoting layer escapes the double quotes in this JSON text; a CSV parser restores the cell contents before a JSON parser reads the nested value.

If a field changes type between records, both its parent column and any discovered child columns can appear. For example, a scalar profile value and a nested profile.city value occupy different columns. This avoids overwriting either representation. JSON numbers are parsed as JavaScript numbers; encode large integer identifiers as strings to avoid precision loss. CSV itself has no type system: null, missing fields, and empty strings all become empty cells, so retain the original JSON when those distinctions matter.

When Should You Use JSON Lines Input?

JSON Lines is useful for exports that store one independent JSON object on each line rather than wrapping everything in an array. Select JSON Lines (JSONL) before pasting, or open a file with a .jsonl or .ndjson extension to select it automatically. Blank lines are skipped, and syntax errors identify the original line number. Pretty-printed objects spanning multiple lines belong in regular JSON array mode instead.

The tool reads the complete input into browser memory. It does not enforce a file-size or row-count quota, but available memory and processing time still constrain large exports. Conversion is synchronous, so a very large dataset can temporarily make the page unresponsive. File import is not a streaming parser. Split oversized exports into smaller files when working on a phone or a device with limited memory.

Which Settings Help Spreadsheet and Data Imports?

Comma is the default separator. Semicolon, tab, and pipe options let you match the importer consuming your file. Quoting follows the selected separator: a semicolon-containing cell needs quoting in semicolon mode, while commas alone do not require quoting in that mode. Carriage returns, line feeds, and double quotes are escaped in every mode. Records are separated by CRLF.

Enable UTF-8 BOM if your spreadsheet application needs an explicit Unicode encoding hint. It changes the downloaded or shared file, while the visible preview and copied text remain free of the marker. Leave it off for pipelines that expect the first byte to belong to the header. Consult your destination's encoding and separator settings if the file opens in one column or characters appear garbled.

Formula protection is enabled by default because spreadsheet applications may interpret certain text as formulas. It prefixes risky strings and headers with an apostrophe, including whitespace-prefixed formula markers. It does not change negative JSON numbers. For an exact text export into a trusted data pipeline, disable this option and review the resulting CSV before importing it into a spreadsheet.

Why Does Conversion Fail or Change Some Values?

A selected record array must contain objects only. Empty arrays, primitive rows, nested arrays used as rows, and datasets consisting entirely of empty objects are rejected. An empty object within a dataset is accepted when another record supplies a column. A single ordinary object is not automatically wrapped as one row; place it in an array or use JSON Lines input.

Malformed JSON stops conversion rather than exporting partial results. Use JSON Validator to investigate syntax or JSON Formatter to inspect an unfamiliar structure before choosing its records. Non-finite numbers are rejected, including overflow inside nested arrays, even with flattening disabled. Finite numbers still follow JavaScript number precision, so strings are safer for long identifiers that must remain exact.

CSV preserves cell text, not the full JSON data model. Boolean values become true or false, while null, missing fields, and empty strings all export as empty cells. A spreadsheet may apply its own type inference after import. Keep identifiers as text in the destination importer and retain the source JSON if you need to recover original types or missing-value distinctions later.

How to Use JSON to CSV Converter

  1. JSON / JSONL input

    Paste a JSON array of objects, or use Open JSON / JSONL file to read a local file. For pasted objects on separate lines, open Conversion options and set Input format to JSON Lines (JSONL).

  2. Root record path

    For a JSON object containing an array of records, select that array in Root record path. Each available array shows its path and record count. A top-level array needs no path change.

  3. Columns and preview

    Review the first 20 source rows. Select included columns, edit Output name, and use Move up or Move down to arrange the export.

  4. Conversion options

    Choose CSV separator and set Flatten nested objects, Protect against spreadsheet formulas, and UTF-8 BOM for spreadsheet downloads as required. Review CSV output after changing settings.

  5. Download CSV

    Check the row and column counts, then select Download CSV to save data.csv. The file uses UTF-8 encoding and CRLF record separators.

Frequently Asked Questions