schwapps.
← All guides

Move spreadsheet data between CSV and JSON

A small export example explains strings, missing fields, and formula-safe CSV output.

CSV rows and JSON objects represent data differently. Before converting, check whether the next system expects text or numbers, how it treats missing values, and whether the file will be opened in a spreadsheet.

Preserve identifiers on the way into JSON

Paste this into CSV to JSON:

id,name,active
00042,Ada,true
00043,Sam,false

The first record is:

{"id":"00042","name":"Ada","active":"true"}

Every value is a string. The ID keeps its leading zeros, but "true" is also text, not the JSON boolean true. This converter deliberately does not infer types. If your receiving API needs a boolean, convert that specific field using its schema and validate the result. Zeros already removed by a spreadsheet cannot be recovered by conversion.

Check headers and quotation marks

Headers must be nonempty and unique after surrounding spaces are trimmed. Every nonempty data row must have the same number of fields. A comma inside a value needs quoting, such as "Lee, Ada". A quotation mark inside a quoted field is doubled. Do not split a CSV file into lines and deduplicate it when fields can contain embedded line breaks.

Understand what happens on the way back

JSON to CSV accepts an array of flat objects. For [{"id":"00042","name":"Ada"},{"id":"00043"}], the output has id and name columns, with an empty name cell for the second record. Nested objects need flattening elsewhere before conversion.

Text beginning with spreadsheet formula markers is prefixed with an apostrophe for safer CSV export. This intentionally changes the cell text. A round trip therefore is not a byte-for-byte backup format, and the receiving spreadsheet still decides how to interpret imported cells.

Inspect before replacing the original

Use the JSON formatter to inspect structure, keeping precision-sensitive identifiers quoted. Test a few records first, including one with an empty cell, a comma, and a leading zero. When importing CSV into a spreadsheet, select text types for identifier columns where your import dialog supports them. Keep the original export until the receiving system has accepted and correctly interpreted the converted data.

Open csv to json ↗