Decide what each column means

Keep the source and work with a small sanitized sample. Write down the delimiter, header row, text encoding, and expected meaning of each column. An order ID such as 00042 is text even though it contains digits. Treating it as a number discards leading zeros. Long identifiers can also lose precision in JavaScript if parsed as numbers.

Agree on how to represent an empty cell. An empty string and JSON null are distinct. CSV has no universal type system or null convention, so apply the receiving application's rule explicitly instead of guessing from the cell contents.

Convert a sample with punctuation and empty cells

Select the actual delimiter and choose whether the first row contains headers. In this comma-delimited fixture, the quoted comma in the note stays inside its cell. The doubled quotes produce one literal quote at each end of Handle gently. Splitting on commas would split the note and shift later fields.

Use unique header names and consistent row widths. The WebToolspire converter keeps CSV cells as strings. The first object should keep order_id as 00042 and the last row should contain an empty note string. Compare specific decoded values rather than counting quote characters in the JSON display.

order_id,note
00042,"Tea, two cartons"
00043,"""Handle gently"""
00044,

Try the CSV to JSON & JSON to CSV Converter →

Check reverse mapping and spreadsheet behavior

A JSON array of objects can map to a CSV table when each property already has a tabular meaning. Define a representation first for nested objects, arrays, and null. If both null and missing values become blank cells, converting back cannot recover which was which.

When sharing data with spreadsheet users, inspect fields that the spreadsheet might interpret as formulas or numbers. Use the converter's spreadsheet-safe export option where appropriate and verify in the intended application. This option can change how values are represented. Keep an unmodified source for programmatic transfers and import identifier columns as text.

Try the JSON Formatter →

Validate a round trip against the field contract

Check row counts, field names, a leading-zero identifier, a quoted value, and an intentionally blank value. When comparing text, normalize line endings only if the receiving system permits it. A diff helps locate changes but will not tell you whether two different representations mean the same thing to your importer.

Run the small fixture through the real receiving system before converting the full file. Keep any type conversions as a separate, reviewable step so blank values and identifiers can be traced back to the source.

Try the Text & Code Diff Checker →

References and further reading