JSON to CSV

Export flat JSON records to CSV and test quoting and column order in the same example.

Export flat JSON records to CSV and test quoting and column order in the same example.

How to use

  1. Load the array of two records with id, name and note.
  2. Convert to CSV and open the result in a plain text editor.
  3. Read the header and compare both rows, paying attention to the embedded comma and quotes.

Worked example

Input

[{"id":"001","name":"林, Mei","note":"She said \"Hi\""},{"note":null,"id":"002","name":"Omar"}]

Expected result

id,name,note
001,"林, Mei","She said ""Hi"""
002,Omar,

Check the result

The header remains id,name,note, with an empty final cell in Omar’s row.

Continue with another guide

Cookie
We care about your data and would love to use cookies to improve your experience.

Learn how we use cookies