JSON and CSV are both plain-text data formats, but they fail in different ways. Validate structure first, preserve the original, and only convert after you know what each field means.
JSON versus CSV
JSON represents objects, arrays, nested values, booleans, numbers, and nulls. CSV represents rows and columns. CSV is convenient for spreadsheets and flat exports, while JSON is better for APIs and hierarchical records. Converting nested JSON to CSV requires decisions about arrays and child objects; there is no single lossless table shape for every document.
Beautify and validate JSON
- Keep an untouched copy of the source.
- Paste the content into the JSON Formatter.
- Run formatting to reveal indentation and syntax errors.
- Check that numbers, booleans, and null values did not become strings.
- Use the JSON Viewer for a collapsible tree when nesting is deep.
Beautifying changes whitespace, not meaning. If the parser rejects the file, fix the reported syntax instead of editing random punctuation.
Common JSON errors
JSON requires double quotes around property names and string values. It does not allow trailing commas or comments. Every opening brace or bracket needs a matching close. Escaped quotes inside a string need a backslash. A valid fragment is not always a complete JSON document; the top level must still be a value such as an object or array.
Clean a CSV before converting
Use the CSV Cleaner to inspect headers, blank rows, duplicate records, and inconsistent columns. Delimiters inside a value must be quoted, and quotes inside quoted values must be escaped according to CSV rules. Confirm character encoding before importing names or international text.
When the table is clean, CSV to JSON can create records, while JSON to CSV can flatten suitable JSON data.
Protect data types during conversion
Spreadsheet software may remove leading zeros, reformat dates, or display long identifiers in scientific notation. Treat phone numbers, postal codes, SKUs, and account identifiers as text. After conversion, compare row counts, headers, totals, null values, and a sample from the beginning and end.