Convert a CSV Table into JSON
CSV is convenient for spreadsheets and data exports, while JSON is commonly used to pass structured records between applications. This CSV to JSON converter reads the first row as the column headings and turns the remaining rows into JSON. You can choose a list of objects, where each heading becomes a property, or a list of arrays that keeps the original column order.
For example, a CSV with headings product_id,name,price and a row 042,Notebook,3.50 can become an object like {"product_id":"042","name":"Notebook","price":"3.50"}. The converter keeps CSV values as text, which helps preserve formatting such as leading zeroes.
Choose between objects and arrays
Array of objects is useful when your code needs to refer to fields by name. Each data row becomes one object, with headings used as keys:
[
{ "product_id": "042", "name": "Notebook", "price": "3.50" },
{ "product_id": "043", "name": "Pen", "price": "1.25" }
]
Array of arrays with header keeps the headings as the first array and places each record in the same column order. This format can be handy when the receiving code already knows which position contains each field:
[
["product_id", "name", "price"],
["042", "Notebook", "3.50"],
["043", "Pen", "1.25"]
]
Pretty print only changes the spacing and indentation of the JSON. Turning it off produces compact JSON; it does not change the selected shape or the values.
How headings and cell values are handled
Object property names need to be usable and unique. Blank headings receive generated names such as Column 2. Repeated names are given a suffix, for example name and name_2. The converter trims heading text for object keys. In array format, the original heading row is kept in its source order.
All cell values are emitted as JSON strings by default. A value that looks like a number, date, or boolean is not automatically changed into another type: 001 remains "001", and true remains "true". Convert types in the application that consumes the JSON if it needs numeric or boolean values.
The Convert empty cells to null option changes cells with no characters into JSON null. A cell containing spaces is not empty to this option and stays a string. Completely blank lines are skipped while reading the file. Rows with fewer cells than the widest row are padded with empty values; extra cells expand the table width and get generated keys in object output.
Convert, review, and save your JSON
- Choose or drop one CSV or TSV file, up to 50 MB.
- Select object or array output. For object output, make sure the first row contains the headings you want as JSON keys.
- Choose whether empty cells should remain empty strings or become
null, then set pretty printing as you prefer. - Review the generated JSON, copy it, or download the complete result as a
.jsonfile.
Large results may be shortened in the on-screen preview to keep the page responsive. Copy JSON and Download JSON still use the complete converted output, not just the visible portion.
Separators, quotes, and file preparation
The converter accepts comma-separated CSV and tab-separated TSV, and attempts to detect semicolon and pipe separators as well. Detection is based on the first non-empty line. If that line contains a separator inside a quoted heading, automatic detection can be ambiguous; check the preview to make sure the columns have been read as expected.
Quoted values can contain commas, tabs, quotation marks, and line breaks without turning those characters into extra columns or records. If the output has unexpected keys or shifted values, check the source delimiter, the heading row, and the number of fields in each record before using the JSON.
The conversion runs in your browser and does not send the file to the RomitCSV server. It creates JSON from a flat table; it does not validate a separate API schema, infer nested objects, or convert strings into application-specific types.
CSV TO JSON FAQ
Questions About Converting CSV to JSON
Does CSV to JSON turn numbers into JSON numbers?
No. Values are kept as strings, so a value such as 001 keeps its leading zeroes. Convert values to numbers or booleans in your application if needed.
Can I convert a TSV file to JSON?
Yes. Select a TSV file and the converter will try to detect the tab separator before creating the selected JSON format.
Does the first row become part of the JSON data?
For an array of objects, the first row supplies the object keys and is not included as a record. For an array of arrays, it is included as the first array.
What happens to duplicate or blank column names?
Object output generates a name for a blank heading and adds suffixes to repeated keys so each property name is unique. Array output keeps the heading names and their order.
Can empty cells become null?
Yes. Turn on Convert empty cells to null. Only cells with no characters become null; cells containing spaces remain strings.
Why is only part of my JSON visible?
The page limits the preview for long results. Copy and Download still include the entire JSON output.
What if the JSON columns do not line up?
Check whether the file uses commas, tabs, semicolons, or pipes and inspect its first row. Automatic separator detection can be uncertain when the heading line contains several separator characters inside quotes.
Are my CSV files uploaded?
No. The conversion happens in your browser, and the original file is not modified.
Use the JSON with the right structure
Before pasting the result into code or sending it to an endpoint, confirm that the selected shape matches what the receiving tool expects. Object arrays are easier to read by property name; array output preserves positional data. If you need to check the source rows first, open the CSV Validator. To turn JSON back into a spreadsheet-friendly file, use JSON to CSV, or browse all CSV tools.