CSV to JSON Converter

Turn a CSV or TSV table into JSON and keep each row together.

Paste or load a table. Choose Comma separated (CSV), Tab separated or Custom separator to match your file.
UTF-8 text files up to 10 MB. For spreadsheets, save a copy as CSV or TSV first.

Conversion requires JavaScript.

Transformations (2 enabled)

ArrayCat cleans up and encodes values before grouping duplicates or sorting. It escapes the values for the output format last.

Cleanup
Encoding
Duplicates and ordering
Counting two copies of apple gives 2:apple.
Saved presets

Presets keep your formats and cleanup settings in this browser.

Delete or overwrite the preset to remove any text saved with it.

Worked example

CSV input
sku,product,stock
001,"Pencil, blue",12
042,Notebook
JSON row objects
[
  {"sku": "001", "product": "Pencil, blue", "stock": "12"},
  {"sku": "042", "product": "Notebook", "stock": null}
]

When First row contains column names is checked, each data row becomes an object. Give each column a name of its own and fix any row with more fields than the header. Uncheck the box for a file with no headers. Each row then becomes an array.

In the example, the second row ends after Notebook, so its missing stock value becomes null. Add a comma after Notebook to include an empty stock cell. That gives "".

Cells stay strings by default, so 12 becomes "12". Select Detect numbers, booleans and null to write it as a number. Use Columns to keep as strings for columns such as ZIP codes. Enter column numbers starting at 1. IDs with leading zeros and numbers that would lose precision stay strings.