Keep leading zeros when converting CSV to JSON
Follow a three-column inventory row from CSV text to JSON and check which values should stay strings.
Download the sample CSVRead a row as a record
The sample has an item code, a supplier, and a unit price. The item code 00123 looks numeric, but the zeros are part of its spelling. If the warehouse searches for an exact string, replacing it with 123 can break the match.
The supplier is written as "Harbor, North". The comma between the quotation marks belongs to the supplier. Splitting the line at every comma creates four values under three headings. Use the converter’s preview to verify the boundaries.
Choose how the receiver expects values
Leave values as text for the first conversion. The item code will appear in quotation marks, and the price will retain its two decimal places. Switch on number conversion and compare the results. The item code changes to 123 and the price 12.50 becomes 12.5.
If your destination requires numeric prices and text identifiers, keep the import as text and convert only the price in your downstream mapping. A single global number switch applies to every eligible field.
Look beyond valid syntax
Open the output in the JSON formatter. Expand the first row and inspect the code, supplier and price. Both conversions produce legal JSON. Only the expected data types tell you which one fits the receiving system.
Try adding a second column named supplier to the source. The converter asks you to rename it because an object cannot represent both values under the same key reliably. Fixing the headings at the source makes the correction reusable on the next import.