CSV to JSON Converter
Convert CSV data into structured JSON, correctly handling quoted fields with embedded commas/newlines.
Why use this tool?
Convert CSV data (from Excel, Google Sheets or exports) into a JSON array of objects, correctly handling quoted fields that contain commas or line breaks.
How to use it
- Paste CSV or upload a .csv file (the first row is used as headers).
- Click Convert.
- Copy the JSON output.
How CSV becomes JSON
CSV (comma-separated values) is the plain-text table format that Excel, Google Sheets and most databases can export. This tool reads the first row as column names and turns every following row into a JSON object with those names as keys, giving you an array of objects that code and APIs can use directly.
For example, the CSV lines name,age followed by Alice,30 become [{"name": "Alice", "age": "30"}]. All values are kept as text, exactly as they appear in the CSV, so nothing is silently changed: ZIP codes keep their leading zeros and long ID numbers aren't rounded.
Quoted fields, commas and line breaks
A value that contains a comma, a quote or a line break must be wrapped in double quotes in CSV, for example "Los Angeles, CA". Inside a quoted value, a literal double quote is written twice (""). This is the convention described in RFC 4180, and it's what Excel and Sheets produce.
Simple converters that just split on commas break these rows apart. This tool parses quotes properly, so an address with a comma or a multi-line note stays in one field.
Troubleshooting
If every row comes out as a single field, your file probably uses semicolons or tabs instead of commas, which is common in countries that use a comma as the decimal separator. Re-export it as comma-separated, or replace the separators first.
If keys look wrong, check that the first row really contains headers. Empty or duplicated header names make the resulting objects hard to use, so give every column a unique name before converting.
Frequently asked questions
Why are numbers in quotes in the output?
Values are kept as strings so nothing is altered (leading zeros, long IDs, dates). Convert the specific fields to numbers in your own code if you need to.
Does it upload my data?
No. The conversion runs in your browser, so the CSV never leaves your device.
Can I go the other way?
Yes, use the JSON to CSV converter to turn an array of objects back into a spreadsheet-friendly CSV.