CSV / JSON Converter
Convert comma-separated CSV with headers to JSON, or flat JSON object arrays to CSV. Supports quoted fields and explains strings, missing values, and formulas.
How to convert a table
- For CSV input, include a first row of unique, non-empty column names.
- For JSON input, use a non-empty array of flat objects.
- Select the matching conversion direction and inspect the output.
- Keep the original before copying the converted result into another system.
A worked example
name,city
Asha,Mysuru
Ravi,"Bengaluru, Karnataka"Selecting CSV to JSON produces:
[
{"name": "Asha", "city": "Mysuru"},
{"name": "Ravi", "city": "Bengaluru, Karnataka"}
]A comma inside a quoted field is preserved as text. Double a quotation mark inside a quoted field, as in "She said ""hello""". Quoted line breaks are supported. The parser accepts CRLF, LF, or CR record endings and removes an optional leading byte-order mark.
Data types and missing values
CSV to JSON produces string values; 0012 stays "0012". It does not guess numbers, booleans, or dates. On JSON to CSV, all object keys are combined in first-seen order, and missing or null values become empty cells. Nested objects and arrays are rejected.
These choices mean the conversion is not a type-preserving round trip. CSV has no way here to distinguish an empty string, a missing property, and null after export. JavaScript parsing may also round very large JSON numbers: keep identifiers as strings when the receiving contract allows it.
Spreadsheet formula handling
By default, exported text beginning with =, +, -, or @ after optional whitespace is prefixed with an apostrophe, including column names. Numeric negative values are not prefixed. This changes the text to reduce accidental formula interpretation; it is not a guarantee for every spreadsheet importer. Inspect untrusted data before opening it in a spreadsheet.
Frequently asked questions
Does it support semicolon or tab-separated files?
No. The delimiter is a comma. Choose a CSV export with comma delimiters first.
Why is a row rejected?
Every row must have the same field count as the header. Empty or duplicate headers, unclosed quotes, and unexpected text after a closing quote are rejected.
What format is this based on?
The quoting convention follows the common CSV structure described in RFC 4180. This implementation intentionally accepts additional line-ending styles.
