Skip to main content

CSV to JSON Converter — turn spreadsheet rows into JSON objects

Paste CSV from Excel, Google Sheets or a database export and get a JSON array with one object per row. Choose the delimiter and header option; everything runs in your browser.

Features

  • Turn CSV rows into a JSON array of objects
  • Comma, semicolon or tab as delimiter
  • Header row becomes the JSON keys, or use column1, column2 …
  • Quoted fields with delimiters, doubled quotes and line breaks
  • Indent with 2 or 4 spaces, tabs, or compact output
  • Runs entirely in your browser, nothing is uploaded

From Spreadsheet Rows to JSON Objects

CSV is what spreadsheets, databases and analytics tools export; JSON is what APIs, JavaScript code and NoSQL databases expect. Converting CSV to JSON is the step in between when you want to seed a database, mock an API response or load a product list into a web app.

This converter turns every data row into one JSON object and collects them in an array. The first row supplies the keys, so a column called email becomes the property "email" in every object.

How Your CSV Is Read

  • Delimiter: comma, semicolon or tab. Other separators such as the pipe | are not offered.
  • Header row: on by default. Turn it off and the keys become column1, column2 and so on, and the first row is kept as data.
  • Quoting (RFC 4180): a field in double quotes may contain the delimiter, line breaks and quotes written twice ("").
  • Blank lines are skipped, and both Windows (CRLF) and Unix (LF) line endings work.
  • Every value stays a string. 30 becomes "30" and true becomes "true". Nothing is guessed, so ZIP codes like 02134 keep their leading zero.

Example

A name containing a comma and a nickname in quotes, read with the comma delimiter and the header row switched on:

id,name,city
1,"Smith, Jane",London
2,"Tom ""TJ"" Lee",

Result with the default indentation of 2 spaces:

[
  {
    "id": "1",
    "name": "Smith, Jane",
    "city": "London"
  },
  {
    "id": "2",
    "name": "Tom \"TJ\" Lee",
    "city": ""
  }
]

The empty last field becomes an empty string, and the doubled quotes turn into an escaped quote in JSON.

Common Pitfalls

  • Wrong delimiter: if each object has a single key holding the whole line, your file uses a different separator. Pick it and click Convert again.
  • Spaces after the delimiter are kept, so name, age produces the key " age".
  • Uneven rows: missing trailing fields are left out of that object; extra fields end up under the key "undefined".
  • Duplicate column names: the last column with that name wins.
  • Unclosed quote: everything after it is read as one field, without an error message.

Useful Resources

RFC 4180: CSV Format The specification for quoting, delimiters and line breaks in CSV files
RFC 8259: The JSON Data Interchange Format The current JSON standard, including strings and escaping
Wikipedia: Comma-separated values History of CSV and its many dialects, from Excel to TSV
MDN: JSON.parse() How to load the converted JSON in JavaScript
Microsoft: Import or export CSV files in Excel How to save a spreadsheet as CSV and which delimiter Excel uses