plato·csv
Open DevTools → Network and paste any JSON or CSV. You will see zero outbound requests from the tool itself. All conversion runs locally in JavaScript. View source on GitHub.

JSON ↔ CSV Converter

Convert JSON to CSV or CSV to JSON instantly in your browser. Handles nested objects, arrays, mixed types, and RFC 4180 escaping. Nothing is uploaded — all processing runs locally.

JSON input
CSV output
CSV input
JSON output

How to use

  1. JSON → CSV: paste a JSON array of objects into the left box and click Convert. Headers are extracted from all object keys automatically. Enable "Flatten nested objects" to expand {"user":{"name":"Alice"}} into a user.name column.
  2. CSV → JSON: paste comma- or tab-delimited data into the left box. The first row is the header. Click Convert to get a JSON array. Enable "Auto-coerce types" to turn "30" into the number 30 and "true" into the boolean true.
  3. Click Copy or Download to save the result. Download saves a properly named output.csv or output.json file.

Frequently asked questions

How do I convert JSON to CSV?

Paste your JSON array of objects into the left box on the JSON → CSV tab. The tool reads every unique key across all objects as a CSV column header, then maps each object's values into rows. Missing keys produce empty cells. Click Convert then Copy CSV to grab the result.

How are nested JSON objects handled?

With "Flatten nested objects" enabled (the default), nested objects are expanded using dot-notation keys. For example {"user":{"name":"Alice","age":30}} becomes two columns: user.name and user.age. Disable flattening to keep nested values as JSON strings in a single cell — useful when the nested structure doesn't map naturally to tabular rows.

How do I convert CSV back to JSON?

Switch to the CSV → JSON tab and paste your CSV. The first row is treated as the header. Each subsequent row becomes a JSON object. With "Auto-coerce types" checked, bare numbers become JS numbers, true/false become booleans, and empty cells become null. Tab-delimited TSV is auto-detected and works without configuration.

What happens when JSON contains arrays as values?

Arrays in object values are JSON-stringified into a single CSV cell, because CSV has no native concept of nested arrays. A value of ["a","b","c"] becomes the string ["a","b","c"] in the cell. On the reverse trip (CSV → JSON) these remain strings; you'd need to JSON.parse them manually to get native arrays back.

How are commas, quotes, and newlines handled?

The tool follows RFC 4180. Any field containing a comma, double quote, or newline is wrapped in double quotes. Double quotes inside a field are escaped as two consecutive double quotes (""). This ensures the output parses correctly in Excel, Google Sheets, Python pandas, and any RFC 4180-compliant parser.

What if my JSON objects have inconsistent keys?

The tool takes the union of all keys found across every object in the array. Objects missing a key get an empty cell for that column. This is the standard behavior for importing heterogeneous JSON into a spreadsheet. If you need only keys present in every row, pre-filter your JSON before pasting.

Does this tool send my data anywhere?

No. All conversion runs in your browser using JavaScript's built-in JSON.parse and string operations. Open DevTools → Network while using the tool and you will see zero outbound requests triggered by your input. Your JSON or CSV never leaves your browser tab.

What JSON input formats are supported?

The primary case is an array of objects: [{...},{...}]. The tool also handles a single top-level object (produces a one-row CSV), deeply nested objects (flattened with dot notation), and arrays of primitives (single-column CSV with a value header).

What is the difference between CSV and TSV?

CSV (Comma-Separated Values) uses commas as delimiters; TSV (Tab-Separated Values) uses tabs. TSV avoids the need to quote fields that contain commas. The CSV → JSON tab auto-detects tabs vs commas in your input, so both formats work without any configuration change.

How can I convert JSON to CSV in JavaScript?

The core algorithm: collect headers with [...new Set(data.flatMap(Object.keys))], then for each row: headers.map(h => escape(row[h] ?? '')).join(',') where escape wraps fields containing commas or double quotes in double quotes, doubling any internal quotes. The full source including nested flattening is readable in this page's view-source.

Examples

API response to spreadsheet

A typical REST API returns a JSON array. Paste it to get a CSV ready for Excel or Google Sheets in one click.

JSON input:
[{"id":1,"user":"alice","score":98},
 {"id":2,"user":"bob","score":74},
 {"id":3,"user":"carol","score":88}]

CSV output:
id,user,score
1,alice,98
2,bob,74
3,carol,88

Nested object flattening

Analytics events with nested metadata are flattened into dot-notation columns automatically.

JSON input:
[{"event":"click",
  "meta":{"page":"/home",
          "ms":142}}]

With flatten ON:
event,meta.page,meta.ms
click,/home,142

With flatten OFF:
event,meta
click,"{""page"":""/home"",""ms"":142}"

CSV import with type coercion

Import a CSV export and get properly typed JSON — numbers stay numbers, booleans stay booleans.

CSV input:
name,age,active
Alice,30,true
Bob,25,false
Carol,,true

JSON output:
[{"name":"Alice","age":30,
  "active":true},
 {"name":"Bob","age":25,
  "active":false},
 {"name":"Carol","age":null,
  "active":true}]

About JSON ↔ CSV conversion

JSON (JavaScript Object Notation) and CSV (Comma-Separated Values) are the two most common data interchange formats in software development. JSON is the native format for REST APIs, NoSQL databases, and configuration files. CSV is the native format for spreadsheets, data exports, and batch imports to relational databases. Converting between them is a routine task for data engineers, backend developers, and analysts — and one that online tools have historically handled poorly.

Most server-side converters require you to upload your file to their servers. That means your API keys, user records, and private business data travel over the network to a third-party machine you don't control. This tool runs entirely in your browser. The conversion happens in JavaScript using the standard JSON.parse API and hand-rolled CSV serialization. Nothing is ever transmitted. You can verify this yourself: open DevTools → Network, paste your data, click Convert. The network tab will show zero requests originating from the tool itself.

JSON to CSV: the algorithm collects the union of all keys across every object in the array (so heterogeneous objects produce a complete header row), then writes each object's values in header order. Nested objects are either flattened into dot-notation columns (user.address.city) or serialized as a JSON string in a single cell, depending on your preference. Array values are always stringified, since CSV has no native representation for ordered lists within a cell.

CSV to JSON: the parser implements RFC 4180 field-quoting rules — quoted fields may contain commas, newlines, and escaped double quotes — and handles both comma and tab delimiters (auto-detected from the first data line). Optional type coercion converts "42" to the number 42, "true" to the boolean true, and empty fields to null, matching the default behavior of pandas read_csv and most database import tools.

The tool handles the real-world edge cases that trip up naive converters: values containing commas, values containing double-quote characters (escaped as "" per RFC 4180), multi-line string values wrapped in quotes, and missing keys in heterogeneous JSON arrays. If you find an edge case it doesn't handle, the full source is readable in the browser at view-source:https://csv.platotools.com/ — no build step, no minification, plain vanilla JavaScript.