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.
Related tools
- JSON to YAML Converter Convert JSON to clean YAML for Kubernetes, docker-compose or GitHub Actions, and YAML back to JSON.
- XML to JSON Converter Convert XML to JSON with attributes, repeated elements as arrays and CDATA, ideal for SOAP responses, RSS feeds and sitemaps.
- Data Converter Convert between JSON, XML, YAML and CSV formats and Unix timestamps. Format conversion with clear error messages and customizable output formatting.
- Unix Timestamp Converter Convert Unix timestamps to readable dates and dates back to epoch time, in seconds or milliseconds.
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,column2and 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.
30becomes"30"andtruebecomes"true". Nothing is guessed, so ZIP codes like02134keep 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, ageproduces 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