Convert CSV data into JSON. Choose whether property names are auto generated or taken from the header
View ToolJavaScript Object Notation (JSON) pronounced as "Jason" is the de facto standard for data interchange on the web these days. It is a simple format that is easier to comprehend than XML. It also has less size than XML because of no closing tags. Interacting with JSON from JavaScript is extremely seamless. JSON format was first specified by Douglas Crockford in the early 2000s
CSV is an old & very popular format for storing tabular data. It has been used in the desktop as well as mainframe. It is a simple & compact format that works really well for tabular data and so is still in use today.
Choose whether to write the header record (which contains the names of the columns) in the output.
name,department
John Doe,Engineering
Jane Doe,Billingr
John Doe,Engineering
Jane Doe,Billingr
Choose which delimiter to use to separate the fields & column names in a record. Acceptable values are:-
name,department
John Doe,Engineering
Jane Doe,Billing
name department
John Doe Engineering
Jane Doe Billing
name department
"John Doe" Engineering
"Jane Doe" Billing
name|department
John Doe|Engineering
Jane Doe|Billing
name;department
John Doe;Engineering
Jane Doe;Billing
This setting governs how the column names are formed in complex JSON structures which have nested objects. You can choose between any of the 4 delimiters which will be used to join the property names and create the output CSV column.
name|department|address_city|address_state
John Doe|Engineering|Atlanta|Georgia
Jane Doe|Billingr|Hayward|California
name|department|address__city|address__state
John Doe|Engineering|Atlanta|Georgia
Jane Doe|Billingr|Hayward|California
name|department|address/city|address/state
John Doe|Engineering|Atlanta|Georgia
Jane Doe|Billingr|Hayward|California
name|department|address.city|address.state
John Doe|Engineering|Atlanta|Georgia
Jane Doe|Billingr|Hayward|California
If selected, Boolean values in Sentence & Capital cases such as True, False, TRUE & FALSE are transformed to their lowercase versions before conversion to CSV. This makes sure that the JSON is valid by cleansing the boolean values. According to the JSON specification, such boolean values are invalid and only lowercase true/false are valid.
Use this if your input JSON has such boolean values in Sentence or Capital casing. However, this will also transform such words inside JSON strings (i.e inside double quotes)
If selected, multiple JSONs in the input are handled. Each Valid JSON must completely exist in one line.
The following input works
{"name": "Robin Hood","department": "","manager": "","salary": 200}
{"name": "Arsene Wenger","department": "Bar","manager": "Friar Tuck","salary": 50}
{"name": "Friar Tuck","department": "Foo","manager": "Robin Hood","salary": 100}
The following input does not work
{"name": "Robin Hood","department": "","manager": "","salary": 200}
{"name": "Arsene Wenger","department": "Bar","manager": "Friar Tuck","salary": 50}
{"name": "Friar Tuck","department": "Foo","manager": "Robin Hood","salary": 100}
Comments 1
John
Wow works great! But I found some small problems with very nested JSON. This solution works a little better https://dev-bay.com/json-to-csv/ it doesn't make array from object so CSV in output is more clean in my opinion.