Free Online CSV to JSON Converter
The CSV to JSON converter parses a CSV table into a JSON array of objects, using the first row as headers. It correctly handles quoted fields, escaped quotes, and commas inside values.
The reverse direction is the JSON to CSV Converter, and the table can be rearranged with the Text Column Formatter. To load the same rows into a database instead, the CSV to SQL Converter handles it.
How to use the CSV to JSON
- 1 Paste your CSV, or load a file. The first row is treated as the header.
- 2 Choose the delimiter if it is not a comma — semicolons and tabs are common.
- 3 Set whether values should be typed as numbers and booleans, or left as strings.
- 4 Copy or download the JSON array.
What CSV cannot express
CSV's simplicity is also its limitation: it is a flat grid with no types, no nesting and no schema. Anything hierarchical has to be flattened before export, and anything about the data's meaning has to be inferred on import. That is why the conversion is a genuine transformation rather than a reformatting.
The most common practical problem is silent type coercion. A spreadsheet that displays a product code as `00123` may export it as `123`, losing the leading zeros, and no converter can recover information that is not in the file.
- The first row is the header unless you say otherwise.
- Keep long identifiers and codes as strings.
- Quoted fields carry embedded delimiters and line breaks.
- Check for a byte-order mark at the start of files exported from Excel.
Frequently asked questions
How are data types handled?
CSV has no types — every cell is text. The converter either keeps everything as strings, which is lossless and predictable, or infers numbers and booleans, which produces cleaner JSON but can misinterpret a value. A telephone number or a postal code with a leading zero should always stay a string.
What happens with a quoted field containing a comma or a newline?
It is handled correctly, provided the field is properly quoted. CSV's rule is that a field containing the delimiter, a quote or a line break must be wrapped in quotes, with internal quotes doubled. A file that does this is parsed correctly; a file that does not is genuinely ambiguous and will be misread.
Why does my output have an empty key?
Because the header row had a trailing delimiter or an empty column name, and a row had a value in that position. Renaming the column in the source, or removing the trailing delimiter, resolves it. Empty headers are a frequent artefact of spreadsheets exported from a selection that included an extra column.
Related Developer Tools
You might also need
Tools from other categories that people pair with the CSV to JSON: