Turn CSV rows into a JSON array of objects. Use the header row as property names and keep every cell value as a string.
How to use
Paste comma separated data with unique, nonempty headers. Each row must have the same number of cells. Copy the JSON for an import script or data sample.
Example
name,city followed by Ada,London produces an object with name set to Ada and city set to London.
FAQ
Will 00123 become a number?
No. All values stay strings. Quoted fields and embedded line breaks are supported, but the delimiter must be a comma.
Related tools
A practical task
Design headers as stable property names before converting. A customer export with name, city, and account_code produces more predictable objects than headers containing long display instructions. Keep a separate field dictionary when names need explanation.
Another useful question
Are blank cells omitted?
A blank cell becomes an empty string in the corresponding property. If the receiving API needs null or a missing key, transform that distinction after conversion.
Details for interpreting the result
| Detail | Explanation |
|---|---|
| Quoted CSV fields | In comma separated CSV, a field containing a comma, quote, or line break needs quotes around it. A quote inside that field is doubled. Splitting every comma by hand loses those field boundaries. |
| Column headers | Headers provide names for columns; they are not extra data values. Keep their order aligned with each row. When building objects, duplicate header names create ambiguity about which value belongs to a key. |
| Strings and values | The JSON string "12" differs from the number 12, and "false" differs from false. Type changes affect comparisons and imports. Keep identifiers as strings when their leading zeros or exact digits matter. |
| Empty and missing data | An empty string, a missing property, and null express different states in structured data. A flat table can merge some of those distinctions. Confirm how missing cells should be handled before converting records. |
| CSV and spreadsheets | CSV stores text and delimiters, not cell formatting. A spreadsheet can interpret a value beginning with a formula marker when opening it. Review imported files rather than assuming quoted cells cannot be interpreted. |
| Numeric precision | JavaScript numbers cannot represent every large integer exactly. Long account numbers, order identifiers, and arbitrary precision decimals should remain strings or use a suitable numeric library in the receiving application. |
| Workbooks and sheets | An XLSX workbook can contain several worksheets, formulas, formatting, and hidden context. A CSV export represents one flat table. Select the intended sheet and retain the workbook when that extra context matters. |