CSV to JSON Converter (and JSON to CSV)

Turn CSV rows into a JSON array of objects, or flatten a JSON array back into CSV for Excel and Google Sheets.

JSON output
[
  {
    "id": 1,
    "zip": "02134",
    "name": "Smith, Ann",
    "active": true,
    "notes": "Line 1\nLine 2"
  },
  {
    "id": 2,
    "zip": "90210",
    "name": "Bob",
    "active": false,
    "notes": null
  }
]

2 rows × 5 columns · delimiter: comma

Or drop a .csv / .tsv file here

or click to browse — max 10 MB, read locally

What this converter is for

CSV is what spreadsheets, CRMs and database exports produce; JSON is what APIs, JavaScript code and document databases consume. Moving data between the two sounds trivial until you hit a customer name with a comma in it, a notes column with line breaks, or a zip code that silently turns from02134 into 2134. This tool converts in both directions and is careful about exactly those cases.

Typical uses: turning a spreadsheet export into fixture data for tests, preparing a JSON payload for a bulk API endpoint, or flattening an API response into a CSV that a colleague can open in Excel.

How to use it

  1. Choose CSV → JSON or JSON → CSV.
  2. Paste your data, drop a file on the drop area, or click Load example.
  3. Leave Delimiter on Auto-detect or pick comma, semicolon, tab, pipe or a custom character.
  4. Set the options: First row is a header and Infer numbers, booleans and null for CSV input; Nested objects, Escape formulas and UTF-8 BOM for CSV output.
  5. The result updates as you type. The line under the output shows rows, columns and the delimiter used. Click Copy or Download.

Worked example

The built-in CSV example has a quoted comma, a two-line note, a zip code with a leading zero and an empty cell:

id,zip,name,active,notes
1,02134,"Smith, Ann",true,"Line 1
Line 2"
2,90210,Bob,false,

With the default options it becomes:

[
  {
    "id": 1,
    "zip": "02134",
    "name": "Smith, Ann",
    "active": true,
    "notes": "Line 1\nLine 2"
  },
  {
    "id": 2,
    "zip": "90210",
    "name": "Bob",
    "active": false,
    "notes": null
  }
]

id is numeric because every value in that column is a plain number, while the whole zip column stays text because one value has a leading zero. The empty cell becomes null. In the other direction, the JSON example with a nesteduser object produces these columns:

id,user.name,user.city,tags,active
1,Ann,Boston,"[""admin"",""dev""]",
2,Bob,,,false

Options explained

  • First row is a header — on: an array of objects keyed by column name. Off: an array of arrays. Empty header cells become column_N and duplicates get a suffix such as id_2.
  • Infer numbers, booleans and null — true/false become booleans, empty cells become null, and numbers are converted only for columns where every value is a number. Turn it off to keep every value as the exact original string.
  • Nested objects — flatten to dot keys for spreadsheet-friendly columns, or keep each object as JSON text. Columns appear in the order keys are first seen across all rows, and missing keys produce empty cells.
  • Escape formulas — protects against CSV formula injection when the file will be opened in a spreadsheet.
  • Add UTF-8 BOM — helps Excel on Windows display accented characters correctly. Leave it off for files consumed by scripts.

Limitations

  • Input is limited to 10 MB; very large files are better handled with a streaming tool such as jq or Python's csv module.
  • Dot-named CSV columns are not rebuilt into nested objects when converting back to JSON.
  • Completely empty lines in the CSV are skipped, and dates are left as text.

Tips

  • European Excel exports often use semicolons; if the row count looks wrong, set the delimiter explicitly.
  • Working with spreadsheets directly? Use Excel to JSON or CSV to Excel.
  • Need the rows in a database instead? The CSV to SQL generator writes INSERT statements for MySQL, PostgreSQL, SQLite and SQL Server.

Frequently Asked Questions

Does the converter handle commas, quotes and line breaks inside fields?

Yes. The parser follows RFC 4180: a field wrapped in double quotes can contain the delimiter, line breaks and doubled quotes (""), so "Smith, Ann" stays one value and multi-line notes stay in one cell.

Why are some numbers kept as strings in the JSON?

Type inference is decided per column. A column only becomes numeric when every non-empty cell is a plain number, so zip codes or IDs such as "02134" keep their leading zeros, and integers larger than 2^53 stay strings because JavaScript would round them.

How are nested JSON objects converted to CSV?

By default nested objects are flattened into dot-separated columns ({"user": {"name": "Ann"}} becomes a user.name column). You can instead keep each nested object as JSON text in a single cell. Arrays are always written as JSON text.

Which delimiters are supported?

Comma, semicolon, tab and pipe, plus any single custom character. In CSV → JSON mode the delimiter is auto-detected from the first line unless you pick one.

What does "Escape formulas" do?

Cells that start with =, +, - or @ can be executed as formulas when the CSV is opened in Excel or Google Sheets. With the option on, such cells are prefixed with an apostrophe; plain negative numbers like -5 are left alone.

Is my data uploaded to a server?

No. Parsing and conversion run in your browser with JavaScript. Files you drop are read locally and never sent anywhere.