← All tools

Stays in your browser

CSV to JSON Converter Online

Free CSV to JSON and JSON to CSV converter. Paste a table or object array and convert locally.

Converting between CSV and JSON

CSV is a flat table, so a faithful conversion has to decide three things: the delimiter, whether the first row is a header, and what an empty cell means. Get one wrong and a numeric column becomes strings, or every field shifts by one position with no error at all.

Quoting is where CSV stops being simple. A field containing a comma, a quote or a newline must be wrapped in quotes with its internal quotes doubled, which is why a hand-edited file can parse differently in two tools. Spreadsheet exports also often begin with a byte order mark that becomes an invisible character glued to the first key.

JSON keeps types and nesting, and CSV does not. Converting a nested object to CSV flattens or discards the structure, and converting back cannot reconstruct it. When the data is hierarchical, CSV is the wrong interchange format and the loss happens in the first conversion, not the second.

FAQ

What is the first CSV row?
The first row is treated as headers.
Quoted fields?
Basic quotes and comma escaping are supported.
Uploaded?
No.
Why does this converter need a header row?
It reads the first line as column names, because JSON needs keys and CSV has nowhere else to put them. If your file has no header, add one first: otherwise the first data row becomes the keys and every remaining record is off by one field.
Why does the first key contain a strange character?
That is a byte order mark left by a spreadsheet export. It is invisible in most editors but becomes part of the first column name, so the key looks correct and does not compare equal to the expected string. Strip it before converting, or rewrite the first key afterwards.
Can CSV represent nested data?
Not faithfully. A nested object either becomes a flattened key such as user.address.city or is dropped, and neither round-trips. If the structure matters, keep it in JSON and treat CSV as an export format for tabular views rather than as the source of truth.

Related tools