JSON to CSV / CSV to JSON

Convert a JSON array of objects into a clean CSV spreadsheet, or turnCSV back into pretty-printed JSON — both directions, and100% in your browser. Nothing is uploaded.

🔒 100% private — runs in your browser, never uploaded.

How to use it

  1. Paste your data into the input box — a JSON array of objects, or raw CSV.
  2. Click JSON → CSV to flatten objects into a spreadsheet, or CSV → JSON to build a list of objects.
  3. Copy the result, or fix any error shown in red and try again.

JSON → CSV: how the conversion works

Your input must be a JSON array of objects, for example[{"name":"Ada","role":"Engineer"}, {"name":"Linus"}]. The tool scans every object and builds the header row from the union of all keys, in the order they first appear. That means objects do not all have to share the same keys — missing values simply become empty cells.

Every value is escaped to valid CSV: if a value contains a comma, a double quote or a line break, the whole cell is wrapped in double quotes, and any quotes inside are escaped by doubling them (" becomes""). Nested objects and arrays are written out as compact JSON so you never lose data.

CSV → JSON: how the conversion works

The CSV reader follows RFC 4180, the de-facto CSV standard. Fields can be wrapped in double quotes, and a quoted field may contain commas, line breaks, and escaped quotes (""). The first rowis treated as the column names, and every following row becomes one JSON object mapping those names to values. The output is pretty-printed with two-space indentation so it is easy to read and diff.

Is it private?

Yes. There is no server round-trip and no upload. All parsing and formatting happens locally in your browser with plain JavaScript, so spreadsheets, exports and API responses — which often contain personal or sensitive data — stay on your device. You can even use the tool offline once the page has loaded.

Common uses

Frequently asked questions

Why does JSON → CSV say my input is not an array?

JSON → CSV needs the top level to be an array of objects, like [{...}, {...}]. A single object or a bare value cannot be turned into rows.

What happens to objects with different keys?

The header is the union of all keys across the array. Objects missing a key get an empty cell for that column, so no data is dropped.

Does CSV → JSON guess data types?

No — every value is kept as a string to stay lossless and predictable. If you need numbers or booleans, cast them after conversion.

Related: JSON Formatter · Base64 encode/decode