JSON to CSV Converter

Convert JSON to CSV, or CSV to JSON - free, no upload.

JSON / CSV converter
Direction
Result

What this tool does

Paste a JSON array of objects to get CSV, or paste CSV to get back a JSON array of objects - switch direction with the toggle above the input box.

Converts a JSON array of objects to CSV, using the union of every object's keys as the header row.

Converts CSV back to JSON, using the first row as field names for each resulting object.

Stringifies nested objects or arrays found inside a value rather than silently dropping or flattening them.

Quotes and escapes CSV fields following RFC 4180 conventions - any field containing a comma, a double quote, or a newline is wrapped in quotes, with embedded quotes doubled.

Fills a blank cell for any object missing a key that other objects in the array have, so columns always stay aligned instead of shifting.

How to use it

  1. Choose a direction: JSON to CSV, or CSV to JSON.
  2. Paste your input.
  3. Copy or download the result.

Why use this converter

Moving data between APIs and spreadsheets means converting JSON and CSV, and nested data complicates it. A converter handles both directions and the union of keys.

Why we built it

We built the JSON to CSV converter to build the header from the union of all object keys, not just the first object's. Tidy the output with the CSV formatter and open it directly as a workbook with the JSON to Excel converter.

Related tools worth a look: the CSV to XML Converter.

Who this tool is for

  • Analysts moving API data into spreadsheets
  • Developers converting fixtures
  • Anyone preparing data for Excel

When to use it

  • Opening API data in a spreadsheet.
  • Turning CSV rows into JSON objects.
  • Preparing data for import.
  • Inspecting records as a table.

Why nested values are stringified, not flattened

There's no single correct way to flatten a nested object into CSV columns.

If a JSON object contains a nested object or array as a value, there's no universally correct way to represent that in a flat CSV column - different tools flatten it differently (dot-notation keys, JSON strings, or just an error). This tool stringifies the nested value as JSON text inside the cell, which is lossless and honest about what's there, rather than guessing at a flattening scheme that might not match what you actually wanted.

There's no single CSV standard - here's the dialect this tool uses

RFC 4180 is a common reference, not a rule every CSV file or tool actually follows.

CSV was never formalised the way JSON was - RFC 4180 documents the most widely used conventions, but plenty of real-world CSV files (and plenty of tools) disagree with it on delimiters, quoting, or line endings. This tool follows the RFC 4180 conventions specifically: a field containing a comma, a double quote, or a newline is wrapped in double quotes, and a literal double quote inside a quoted field is escaped by doubling it (""). Output rows are joined with CRLF (\r\n) line endings, matching the RFC, even though many Unix-originated tools would only emit a bare \n.

Only the comma delimiter is supported - there's no option to switch to semicolon or tab, which some regional CSV dialects (for example, Excel set to a locale that uses comma as the decimal separator, so it exports semicolon-delimited files) use instead. If your source file uses a different delimiter, it needs converting to comma-delimited first.

When converting JSON to CSV, the header row is built by walking every object in the array in order and adding any key not already seen - so if some objects have fields others don't, every object still gets a matching column, with objects missing that key given an empty cell rather than the row shifting out of alignment.

CSV to JSON assumes the first row is a header row and treats every cell as a plain string - it does not sniff or auto-detect a different delimiter.

What you give it, and what you get back

Input and output of JSON to CSV Converter
ItemDetails
InputA JSON array of objects, or CSV with a header row.
OutputCSV or JSON.
NotesNested values become JSON text in a cell.

Issues you may run into

Common problems with JSON to CSV Converter
What you seeWhy it happensWhat to do
Numbers become stringsCSV has no types.Convert types in your code.
Nested data is one cellIt is stringified.Flatten the data first.
An error message appearsThe input is not valid for this format.Fix the problem the message points to.

Assumptions and limitations

Frequently asked questions

How do I convert JSON to CSV for free?

Paste a JSON array of objects and choose JSON to CSV - the header row is built from every key across all objects.

How do I convert CSV to JSON?

Paste your CSV and choose CSV to JSON - the first row becomes the field names for each resulting object.

What happens to nested objects or arrays in JSON to CSV?

They're stringified as JSON text inside the cell, since there's no single correct way to flatten them into columns.

Are numbers preserved when converting CSV to JSON?

No - CSV has no type information, so every value becomes a JSON string.

Is my data uploaded anywhere?

No. Conversion happens entirely in your browser.

Does this tool follow the official CSV standard exactly?

It follows the RFC 4180 conventions for quoting (wrapping fields containing a comma, quote or newline in double quotes, doubling embedded quotes) and uses CRLF line endings - but RFC 4180 is a common reference, not a universally enforced standard, so a CSV file exported from another tool may use different delimiters or quoting rules.

What happens if my JSON objects have different sets of keys?

Every key seen across any object in the array becomes a column. Objects that don't have a particular key just get an empty cell in that column, so rows stay aligned instead of shifting.