All tools

CSV ↔ JSON Converter

Convert between CSV and JSON, with header row support

How it works

CSV ↔ JSON ConverterConvert between CSV and JSON, with header row support. All processing happens in your browser — no upload, no signup, no email required. Free forever.

Last updated:

About CSV ↔ JSON Converter

CSV is the lowest-common-denominator data format: every spreadsheet, every database export tool, every legacy system speaks it. JSON is the lingua franca of modern APIs and JavaScript code. Converting between the two is a daily task for anyone who imports analytics dumps, seeds a database from a spreadsheet, or pipes survey results into a web app — and yet doing it correctly with quoted fields, embedded commas, and non-comma delimiters is surprisingly fiddly.

This bidirectional converter handles the corner cases automatically. CSV → JSON respects RFC 4180 quoting (so a quoted field with a comma stays one field), supports custom delimiters for European ";" exports and tab-separated files, and uses the first row as object keys when you ask it to. JSON → CSV takes an array of objects and produces a properly quoted CSV with the union of all keys as the header row, so missing fields become empty cells instead of silent shifts.

Everything runs in your browser. Whether the file is a 100-row demo or a 50,000-row export with PII, the data stays on your machine. That privacy property matters when the CSV in question contains real user data you should not be uploading to a random web service.

How to use CSV ↔ JSON Converter

  1. Paste your CSV into the CSV side, or your JSON array into the JSON side.
  2. Set the Delimiter to "," (default), ";" for European CSVs, "\t" for TSV, or any single character.
  3. Toggle "First row is header" on so the CSV column names become JSON object keys.
  4. Click "CSV → JSON" or "JSON → CSV" depending on direction.
  5. If you see "Invalid CSV" or "JSON must be an array of objects", fix the input shape and retry.
  6. Copy the converted output into your data import tool, code editor, or test fixture file.

Common use cases

  • Importing a spreadsheet export into a JavaScript app or test fixture as a typed array of objects.
  • Producing a CSV for non-technical stakeholders from a JSON API response.
  • Migrating data between two systems where one only exports CSV and the other only accepts JSON.
  • Converting a European ";"-delimited CSV into JSON without first opening Excel and re-saving as comma-delimited.
  • Quickly inspecting a TSV log dump as JSON so you can pipe it through jq or query it with JavaScript.

Tips & common mistakes

  • If your CSV contains commas inside text fields, the field must be wrapped in double quotes (RFC 4180). Unquoted commas will be parsed as column boundaries.
  • Excel often defaults to ";" as the delimiter on systems with a comma decimal separator (most of Europe and Turkey). Set the Delimiter accordingly if your CSV looks like one giant column.
  • JSON → CSV requires a flat array of objects. Nested objects become "[object Object]" cells — flatten or stringify nested fields first.
  • Number-like strings ("007", "+90 555…") may be silently coerced to numbers and lose leading zeros. Wrap such columns in quotes in the source CSV to be safe.

Frequently asked questions

Are quoted fields and embedded commas handled?

Yes. Our parser supports RFC 4180-style quoting, including escaped double quotes (""") inside fields and commas/newlines inside quoted strings.

Can I use a different delimiter than comma?

Yes. Set the delimiter to ; (semicolon), \t (tab), |, or any single character. This is essential for European CSV exports that use ; by default.

Why does JSON → CSV require an array of objects?

Each object becomes one CSV row, with keys forming the header. We collect the union of all keys so missing fields appear as empty cells.

How are line breaks inside CSV fields handled?

If the field is wrapped in double quotes (per RFC 4180), embedded line breaks are preserved as part of the value. Unquoted line breaks always end the row.

Can I convert deeply nested JSON into CSV?

Not directly — CSV is a flat tabular format. Flatten your objects (e.g. "address.city" as one column) before converting, or stringify nested fields so each one becomes a JSON-encoded cell.

Does the JSON output preserve column order from the CSV?

Yes. JSON objects use the column order from the header row, so downstream code that iterates Object.keys() sees the same order as the source CSV.

Latest from the blog

Related tools