Convert CSV to JSON while retaining text such as leading zeros
CSV to JSON assigns names from a header row to cells in each following row. It gives you an array of records that can be searched, edited, or sent to an API.
When should you use it?
- Move a spreadsheet export into a JSON workflow.
- Preserve leading zeros in account identifiers.
- Inspect quoted commas and line breaks as cell values.
Example: keep leading zeros
Both cells remain strings, so the identifier is not converted to the number 1.
id,name
001,Alex[{"id":"001","name":"Alex"}]Treat the header and quoting as part of the format
The header row supplies object keys. A quoted cell can contain a comma, a quote escaped by another quote, or even a line break. Those are ordinary CSV cases, which is why splitting the text on commas or newlines can create incorrect records. Check the first converted row against the original header before processing the whole output.
Convert types only after you know the field meaning
This tool keeps every cell as a string. That preserves a postal code such as 00123 and avoids guessing whether a date is day-first or month-first. If an API requires numeric quantities or booleans, convert those specific fields deliberately after import. An empty cell remains text too; decide in your application whether it means an empty string, a missing value, or null.
Turn rows into named records.
The first CSV row supplies property names. Quoted commas, line breaks, and doubled quotes are parsed without executing cell formulas.
Open CSV
Paste text or choose a local UTF-8 CSV file.
Check the columns
Headers must be nonempty and unique; irregular rows receive an error.
Export JSON
Copy or download an array of objects with text values.
How do I convert CSV to JSON without losing leading zeros?
Use a header row and import the CSV as text. The converter deliberately keeps every cell as a JSON string, so identifiers such as 00123 and values that look like dates remain unchanged. Convert selected fields to numbers later only when the application contract requires it.
CSV input and resulting JSON record
textCSV: id,name
00123,Alex
JSON: [{"id":"00123","name":"Alex"}]Quoted commas and line breaks are supported. Duplicate or empty headers and rows with the wrong number of cells produce errors.
Will the converter run a spreadsheet formula in a CSV cell?
No. Formula-like text such as =SUM(A1) remains a string in JSON. If you later export it to a spreadsheet, review the receiving application’s formula behavior.
What should you check before using the result?
No type inference occurs: 42, true, and dates remain strings. Rows must match header width, with at most 100 columns and 200,000 cells.
Why values remain strings
Values such as 001, long account numbers, dates, and =SUM(A1) should not be silently reinterpreted. The converter keeps them as text so you can choose types deliberately in a later step.
CSV boundaries
The input is limited to 100 columns and 200,000 cells. It expects comma separation and a header row. Empty cells become empty strings; it does not infer null, booleans, or numbers.
Technical reference: CSV records and quoting · RFC 4180