Go REST

JSON to CSV and CSV to JSON

Convert between an array of JSON objects and CSV. Edit either pane and the other updates live. Configure the delimiter, header row, and quoting style.

JSON (array of objects)

CSV

JSON and CSV are useful in opposite worlds

JSON is the native format for APIs, configs, and pretty much anything a developer writes. CSV is the native format for spreadsheets, databases imports, and pretty much anything a non-developer opens. The conversion between them is one of the most common day-to-day transforms.

The mismatch is shape. JSON has nesting; CSV is flat. JSON has types; CSV has only strings. This tool handles the obvious cases (an array of flat objects), but anything deeper than one level loses fidelity on the trip through CSV.

When to use this tool

  • Exporting an API response for a spreadsheet.Paste the JSON, copy the CSV, drop into Excel or Google Sheets.
  • Importing a spreadsheet into a seeding script.Save the sheet as CSV, paste here, copy the JSON, ship it.
  • Building test fixtures.A CSV from the QA team becomes an array of objects you can JSON.parse in a test file.
  • Reshaping data without code.Need to add a column? Edit the CSV. Need to add a deep property? Edit the JSON. The tool keeps them in sync.

What this tool does well

  • Header detection.The first row of the CSV becomes the keys; flip off "Header row" if your data has no header.
  • Mixed-key objects.If row 1 has keys A, B, C and row 2 has keys B, C, D, the CSV header is the union (A, B, C, D) and missing cells are empty.
  • Embedded delimiters and newlines.A quoted CSV field can contain the delimiter and embedded newlines; the parser handles this correctly.

Common pitfalls

  • Numeric strings.JSON "007" survives the round trip; bare 007 would not be valid JSON in the first place. CSV has no types, so importing a CSV column of 007, 008, ... gives you string values.
  • Nested objects flattened to a single cell.A JSON value that is itself an object or array becomes a JSON string in the CSV cell. Useful as a fallback, but if you need a real flatten (one column per nested key), transform the JSON first.
  • Excel and the BOM.Excel needs a UTF-8 BOM at the start of CSV files to display Unicode correctly. This tool does not add one (the output is meant to be pasted, not downloaded); add it if you save to a file and open in Excel.
  • Quote style."Always quote" is safer when the data may be re-imported by a strict CSV parser. The default ("only when needed") is more readable and what most exporters do.