HomeText & Developer Tools › JSON to CSV Converter

JSON to CSV Converter

Paste a JSON array to get a CSV with automatic headers and correct quoting, or paste CSV to get a JSON array of objects - both directions run in your browser.

From JSON to CSV

CSV is a flat grid and JSON is a tree, so the conversion has to decide what to do about nesting. This tool takes the array you paste, walks every object in it, and collects the union of their keys in first-seen order - that becomes the header row, so records with missing fields simply get an empty cell instead of shifting columns. A nested object is flattened one level using dotted keys, so {"address": {"city": "London"}} becomes a column named address.city. Arrays and anything deeper than one level are written into the cell as compact JSON text, which keeps the data recoverable without inventing dozens of columns.

Quoting follows RFC 4180, the closest thing CSV has to a standard. A value is wrapped in double quotes only when it needs to be: when it contains the delimiter, a double quote, or a line break. A quote inside a quoted value is doubled, so Katherine Johnson, PhD comes out as "Katherine Johnson, PhD" and He said "hi" becomes "He said ""hi""". Booleans are written as true and false, and null and missing keys both become empty cells.

From CSV back to JSON

The reverse direction runs a real character-by-character parser rather than splitting on commas, which is the only way to survive quoted fields. It tracks whether it is inside quotes, so a comma or a newline inside "Johnson, PhD" does not break the row, and it collapses doubled quotes back into one. The first row becomes the keys; blank header cells are renamed column1, column2 and so on. A leading byte order mark - the invisible character Excel writes at the start of a UTF-8 CSV - is stripped, because otherwise your first key would carry it and lookups would silently fail.

With type conversion on, values that look like numbers become numbers, and true, false and null become the matching JSON literals; everything else stays a string. Leading zeros are deliberately left alone, so a ZIP code like 02134 or a phone number stays text rather than turning into 2134. Turn the option off when every field must remain a string, which is often what a downstream import expects.

Delimiters, Excel and gotchas

Pick the delimiter that matches your file. Comma is the default worldwide, but Excel on a machine with a European locale writes and expects semicolons, and exports from analytics tools often use tabs. If CSV to JSON produces one giant column, the delimiter is wrong. Tab-separated data is the safest choice when values may themselves contain commas.

Two Excel-specific traps are worth knowing. Long digit strings - order IDs, IMEIs, credit card numbers - are parsed by Excel as numbers and displayed in scientific notation, permanently losing digits when the file is saved again; import the column as Text or prefix the cell with an apostrophe. And a cell that begins with =, +, - or @ is treated as a formula, which is the basis of CSV injection attacks against spreadsheets; if the data came from untrusted users, prefix such cells before sharing the file. Everything on this page is computed locally, so exports containing customer data never leave your browser.

Frequently asked questions

What happens to nested objects and arrays?

Objects are flattened one level into dotted columns such as address.city. Arrays and deeper structures are stored as JSON text in a single cell, which keeps them readable and reversible without exploding the column count.

Why is my CSV coming out as one column?

The delimiter does not match. Choose semicolon or tab in the dropdown to match your file - Excel in many European locales writes semicolons even though the file is still named .csv.

Does it handle commas and quotes inside values?

Yes, in both directions. Values containing the delimiter, a quote or a newline are wrapped in double quotes with inner quotes doubled, and the CSV parser understands that same convention.

Is my data uploaded anywhere?

No. Parsing and conversion happen entirely in your browser with JavaScript, with no network requests, so exported records stay on your machine.