Convert JSON records to CSV without confusing cells and types
JSON to CSV maps a record or an array of records into spreadsheet-style rows. Column names come from the union of top-level keys.
When should you use it?
- Open API records in a spreadsheet.
- Hand tabular data to a CSV importer.
- Compare field coverage across a small dataset.
Example: records become rows
Top-level names form the header. Spreadsheet import settings still control how cells are interpreted.
[{"name":"Alex","score":42},{"name":"Sam","score":38}]name,score
Alex,42
Sam,38Start with a table-shaped set of records
CSV has rows and columns but no object or array type. Choose records with stable field names and inspect nested values before exporting. Quotes, commas, and line breaks inside a cell require CSV quoting; a comma in a customer name should remain part of one cell. Use a CSV parser when reading the result rather than splitting every line on commas.
Know what a spreadsheet may reinterpret
CSV does not declare that an identifier is text or that a value is a date. A spreadsheet may convert 00123 into 123 or interpret formula-like text. The optional formula protection changes those cells to reduce that risk, so review it when exact text matters. Choose XLSX export when preserving supported cell types in a workbook is more useful than a plain text interchange file.
Give each record a row.
The union of top-level property names becomes the header row. Values are escaped for comma-separated CSV, with CRLF line endings and doubled quotes inside quoted cells.
Provide records
Paste a nonempty array of objects, or one object.
Choose formula protection
Keep protection enabled for spreadsheet-bound data unless you need exact text.
Download the CSV
Review the output and choose how your spreadsheet imports column types.
How do I export JSON records to CSV with missing fields?
Provide one object or a nonempty array of objects. The converter builds a header from all top-level property names and writes one row per object. A missing property becomes an empty cell; a nested object becomes JSON text within one cell.
JSON records with a missing column
json[
{"name":"Alex","score":42},
{"name":"Sam"}
]The CSV header is name,score. Sam’s score cell is empty. This differs from an explicit JSON null, which is written as the text null.
Can CSV cells starting with an equals sign be dangerous in a spreadsheet?
Spreadsheet applications may interpret formula-like text. Keep formula protection enabled for untrusted text; it adds an apostrophe to qualifying strings and therefore intentionally changes those exported cells.
What should you check before using the result?
CSV cannot preserve every JSON type or distinction, and spreadsheet apps may reinterpret cells. Choose text import for identifiers and review formula protection before sharing untrusted data.
Nested and missing values
Objects and arrays inside a record are serialized as JSON in a single cell. Missing properties become empty cells; null is written as null. This is a tabular export, not a reversible encoding of every JSON type. Spreadsheet import can also reinterpret dates and long numbers.
Spreadsheet formulas
With protection enabled, string cells and headers beginning with formula-like characters receive a leading apostrophe. This deliberately changes their text and reduces accidental formula execution. Spreadsheet behavior varies, so import untrusted CSV as text and review it. Numeric negatives remain numbers.
Technical reference: CSV records and quoting · RFC 4180