DevTools Logo

JSON to CSV Converter

JSON to CSV

Flatten JSON objects into a spreadsheet-ready CSV table, entirely in your browser.

Runs in your browser
Try an example

JSON input

Paste a JSON array of objects (or a single object). Nested objects become dotted column names, scalar arrays can be joined with a configurable separator, and columns are collected in first-seen order or sorted alphabetically. Output follows RFC 4180 with minimal or forced quoting and a choice of CRLF or LF line endings. Formula-like cells can be prefixed with an apostrophe before opening the CSV in a spreadsheet. Parse errors include a line and column with a plain-language fix.

  • Users array — Becomes a name,age header followed by one CSV row per object.
  • Nested profile — Flattened into columns such as user.name and user.profile.role.
  • Formula-safe export — With formula neutralization enabled, spreadsheet-hostile cells are prefixed with an apostrophe.

CSV output

No CSV yet

Paste a JSON array of objects or load an example.

Examples

Users

Input
[{"name":"Ada","age":36},{"name":"Gráce","age":29}]
Output
name,age
Ada,36
Gráce,29

One header row plus one row per object.

Nested profile

Input
{"id":1,"user":{"name":"Ada"}}
Output
id,user.name
1,Ada

Nested keys become dotted column names.

Quoted comma

Input
[{"name":"Doe, Jane"}]
Output
name
"Doe, Jane"

Minimal RFC 4180 quoting protects the comma inside the field.

About this tool

Spreadsheets need rectangular rows; API responses are trees. This converter flattens a JSON array of objects into a CSV table: nested objects become dotted column names, scalar arrays can be joined inside a cell, and columns are collected from all rows in first-seen order. Ragged objects are filled with empty cells so every row has the same number of fields.

Serialization follows RFC 4180: fields are quoted only when they contain a delimiter, a quote or a line break, quotes are doubled, and CRLF or LF endings are selectable. A formula-neutralization option prefixes cells beginning with =, +, - or @ with an apostrophe so a spreadsheet does not execute them. Optional warnings report nulls, collisions and nested arrays.

Parse errors are mapped to a line and column with a plain-language fix, and invalid input never replaces the last good output. All conversion happens locally — JSON pasted here is never uploaded.

What this tool does not do

  • Nested arrays of objects cannot be represented as multiple CSV rows; they are flattened or JSON-stringified.
  • Integers beyond JavaScript's safe range may be rounded by JSON.parse before conversion.
  • CSV carries no type information; spreadsheet programs re-interpret values on import.
  • Inputs are held in memory; very large JSON documents can slow the browser.

How to use this tool

  1. Paste JSON

    Use an array of objects or a single object. A single object is treated as one row.

  2. Choose output options

    Select comma, semicolon or tab, CRLF or LF endings, and whether to flatten arrays, sort columns or quote every field.

  3. Protect spreadsheet cells

    Turn on Neutralize formulas when the JSON comes from an untrusted source and cells may begin with =, +, - or @.

  4. Review warnings

    The output panel reports null values, column collisions and nested arrays that could not be represented as plain cells.

  5. Copy or download

    Copy the CSV or download data.csv. Shortcut: Mod/Ctrl+Shift+C copies the result.

Use cases

API export

Move a JSON endpoint response into a spreadsheet for a non-technical colleague.

Fixture data

Turn JSON test fixtures into a tabular import file for a database or admin panel.

Reporting

Flatten nested metadata into columns for a quick pivot or chart.

Serialization settings

SettingBehavior
DelimiterComma, semicolon or tab; fields containing it are quoted
Line endingsCRLF for spreadsheet compatibility or LF for Unix tooling
Nested objectsFlattened to dotted column names such as user.profile.role
Scalar arraysJoined with a configurable delimiter, or kept as a JSON string
Column orderFirst seen across all rows, or alphabetical
Formula neutralizationPrefixes = + - @ cells with an apostrophe before spreadsheet import

Numbers and booleans from JSON are written as plain cell text; dates remain whatever string the source provided.

Common mistakes

Mistake:Expecting arrays of objects to become multiple rows.

Fix:Only the outer array becomes rows; nested arrays are joined inside a single cell unless you flatten them upstream.

Mistake:Opening untrusted CSV without formula neutralization.

Fix:Enable the option when cells may start with =, +, - or @ to prevent spreadsheet formula execution.

Mistake:Assuming dates and numbers are typed by the converter.

Fix:CSV has no type system; values are written verbatim and the spreadsheet decides how to parse them.

Frequently asked questions

How are nested objects converted?

Nested object keys are joined with dots, so {"user":{"name":"Ada"}} produces a column named user.name. Arrays of scalar values are joined inside a single cell by default; you can turn Flatten arrays off to keep the JSON representation instead. Arrays of objects do not become multiple rows — the outer array defines the rows.

What happens when objects have different keys?

The column list is the union of all keys seen in any row, in first-seen order unless Sort columns is enabled. Rows that lack a column receive an empty cell, so the CSV stays rectangular.

Why does my spreadsheet execute a cell as a formula?

CSV has no type metadata, so a cell beginning with =, +, - or @ can be interpreted as a formula. Turn on Neutralize formulas in the options: the converter prefixes those cells with an apostrophe, which most spreadsheets treat as literal text.

Which delimiter and line endings should I use?

Comma with CRLF is the RFC 4180 default and works in Excel. In locales where comma is the list separator, choose semicolon; for Unix tooling and diffs choose LF line endings. Fields containing the chosen delimiter are always quoted.

Does it preserve large numbers exactly?

JSON.parse runs in the browser's JavaScript engine, so integers beyond Number.MAX_SAFE_INTEGER can be rounded before conversion. For exact large identifiers, keep them as strings in the source JSON.

What do the warnings mean?

Warnings report null values, key collisions after flattening and nested arrays that were joined or stringified. They are informational: the CSV is still produced, but the notices tell you where information may have been simplified.

Is my JSON uploaded anywhere?

No. Parsing, flattening and CSV serialization run locally in this tab. Nothing is stored or transmitted.

References & standards