How to Convert JSON to CSV
Paste valid JSON containing one object or a nonempty object-starting array, choose a delimiter if needed, and convert it to CSV. Review the header, empty values, and row count in the generated text.
What this JSON to CSV converter does
JSON to CSV conversion is useful when structured records need to be represented as rows and columns. This tool accepts JSON text and produces CSV text, with a delimiter you can leave at the default comma or replace with another character. It is designed for input that represents one object or a nonempty list beginning with an object.
Before converting, check that the JSON is valid and that the records have a structure you can represent in columns. The resulting header is assembled from field names found across the processed records. This makes the output useful when records contain some fields that other records do not, but the column order follows first discovery rather than a separately supplied schema.
Step-by-step instructions
-
Prepare the JSON text. Use one JSON object for a single record, or use a nonempty JSON array whose first item is an object. Do not submit empty or whitespace-only input, malformed JSON, an empty array, or a top-level value such as a string or number.
-
Open the JSON to CSV converter and paste the JSON into its input area.
-
Choose a delimiter if needed. Leaving the setting empty uses a comma. If you provide more than one character, only its first character is used, so enter the intended delimiter as a single character.
-
Start the conversion and review the generated CSV text. The header lists distinct field names in the order in which they are first encountered. Each processed record produces one row after the header.
-
Check fields that are absent from individual records. Their corresponding CSV value is an empty string. Values written into CSV rows are converted to text, so inspect the result when your records contain values that need a particular textual representation.
-
If conversion fails, validate the JSON syntax first. For an array, also inspect every later item: the initial check requires the first item to be an object, but later items are not independently validated and a later scalar, null, or array can still cause processing to fail.
How to interpret the result
Read the first CSV line as the header and the following lines as one row per processed record. If records do not share the same fields, expect the header to include the union of the field names found during processing. A missing field is represented by an empty value in that row.
The delimiter determines how columns are separated in the generated text. A blank delimiter setting returns to a comma, while a multi-character setting is reduced to its first character. Confirm that this matches the format expected by the next system using the CSV.
The converter does not establish a general conversion rule for every possible JSON value. An empty array, an array beginning with a non-object, and other top-level values are rejected. A later non-object item in an otherwise eligible array may fail during processing rather than producing a clean result. Also, values are written as text; the available behavior does not establish that nested objects or arrays become separate CSV columns.
Worked example
You have two records, one with name and role fields and another with name and team fields, and you want CSV text with a shared header.
Submit the JSON array and leave the delimiter set to its default comma, then inspect the generated header and rows.
The CSV has a header containing name, role, and team in first-seen order, followed by two data rows. The second row has an empty value under role.
Limitations
- The verified behavior does not cover arbitrary top-level JSON values or guarantee clean handling of later non-object array items. Values are converted to text, and nested objects or arrays are not established as separate CSV columns.
Common errors
- Cause: The input is malformed, uses an unsupported top-level value, or contains a later array item that is not an object. Correction: Validate the JSON, confirm that an array is nonempty and starts with an object, then inspect every later item before trying again.
FAQ
Can I convert a single JSON object to CSV?
Yes, when the JSON is a single object, that object is processed as one record. A nonempty array must begin with an object, and other top-level JSON values are rejected.
What happens when one record is missing a field?
A missing field becomes an empty CSV value for that record. The header can still include the field when it was found in another processed record.
Can I use a delimiter other than a comma?
A supplied delimiter is converted to text and reduced to its first character when it has more than one character. An empty supplied value falls back to a comma.