JSON to CSV Converter

This tool allows you to convert JSON data to CSV format easily.

To convert JSON to CSV, the JSON data should be in a specific format. The JSON data should either be an array of objects or a single object with specific key-value pairs. Here's a brief explanation of both formats:

Array of Objects:

[
  {"name": "John", "age": 30, "city": "New York"},
  {"name": "Alice", "age": 28, "city": "San Francisco"}
]

In this format, each object represents a row in the CSV file, with keys like "name", "age", and "city" representing the column headers.

Single Object:

{
  "data": [
    {"name": "John", "age": 30, "city": "New York"},
    {"name": "Alice", "age": 28, "city": "San Francisco"}
  ]
}

In this format, the "data" key contains an array of objects, similar to the first format.

The script checks for these formats when converting JSON to CSV and processes the JSON data accordingly.