Converting CSV to JSON is a common operation in data engineering, web development and data science. CSV files from Excel, Google Sheets or database exports often need to be transformed into JSON to be consumed by an API or a JavaScript application.
A CSV (Comma-Separated Values) file is a tabular representation: the first row contains column headers, and each subsequent row is a record. The conversion to JSON creates an array of objects where each object corresponds to a CSV row and each key corresponds to a column header. The delimiter can be a comma, semicolon or tab depending on the region.
📊 Reference table
| CSV (input) | JSON (output) |
|---|---|
| name,age,city | [ |
| Alice,30,Paris | {"name": "Alice", "age": "30", "city": "Paris"}, |
| Bob,25,Lyon | {"name": "Bob", "age": "25", "city": "Lyon"} |
| ] |