All guides

How to convert CSV to JSON and JSON to CSV

Header rows become object keys, and arrays of objects become tables — locally, with quoted commas preserved on the way in.

CSV → JSON uses the first row as keys

CSV ↔ JSON Converter at /tools/csv-json-converter in CSV → JSON mode parses commas, quoted fields, and doubled quotes inside quotes. The first row is headers. Each following row becomes an object. Example: name,age then Ada,36 becomes [{"name":"Ada","age":"36"}] — values stay strings unless you convert types in your app. A ragged row still produces an object; missing cells are empty strings.

JSON → CSV needs an array of objects

JSON → CSV requires a JSON array of objects, not a lone object and not nested arrays as rows. Keys from the objects become the header. Nested objects are stringified poorly for spreadsheets — flatten first. Cells that contain commas are quoted. Invalid JSON is rejected before conversion. YAML ↔ JSON and XML ↔ JSON are different formats; do not paste YAML here.

Steps

1) Open CSV ↔ JSON Converter. 2) Choose CSV → JSON or JSON → CSV. 3) Paste the table or the array. 4) Copy the result — conversion updates as you type on live article pages. 5) Open JSON Formatter if the JSON is valid but hard to read. Use Fake JSON if you needed sample rows rather than a conversion.

Worked example

CSV: name,role / Ada,eng / Lin,design → two objects. Round-trip JSON → CSV should restore a header and two data rows. A semicolon-separated European export is not comma CSV — replace separators first or the parser will see one column. Nothing is uploaded. Close the tab if the sheet has emails or payroll.

Related converters

YAML ↔ JSON for config. XML ↔ JSON for SOAP-ish documents. JSON → TypeScript for types. JSON Compare to diff two dumps after conversion. Number Base Converter is for integers, not tables.

Privacy

Spreadsheets stay in the browser. Related: /tools/json-formatter, /tools/yaml-json-converter, /tools/fake-json.