Free online tool

CSV to JSON Converter

Paste CSV data and get clean, structured JSON — with header handling and custom delimiters.

Runs entirely in your browser
[
  {
    "name": "Ada",
    "age": "36",
    "city": "London"
  },
  {
    "name": "Alan",
    "age": "41",
    "city": "Manchester"
  }
]

Why convert CSV to JSON?

CSV is the lingua franca of spreadsheets — Excel, Google Sheets, and every analytics tool can export it — but modern APIs, JavaScript apps, and NoSQL databases prefer JSON. Converting between the two is one of the most common everyday chores for developers, marketers, and data analysts. Doing the conversion in your browser means the data never leaves your device, which matters when the CSV contains customer emails, revenue figures, or anything else you would not paste into a stranger's website.

How this parser handles edge cases

Real CSV files rarely look like the textbook example. This parser correctly handles quoted fields, escaped quotes ("" inside a quoted string), embedded commas, and Windows-style CRLF line endings. Choose the delimiter from the dropdown (comma, semicolon, tab, or pipe) to match what your source software exported. When "First row is a header" is checked, the parser uses the header cells as object keys; otherwise you get an array of arrays.

Where the JSON output shines

Structured JSON is easier to feed into fetch/axios calls, MongoDB imports, JavaScript for-loops, and modern data tools like DuckDB or jq. It also plays nicely with schema validation libraries like Zod or Yup, which lets you catch bad rows before they hit production. For very large files, consider streaming parsers like Papa Parse in your own build — this in-browser tool is designed for files up to a few megabytes.

+How large a file can I paste?

Comfortably up to about 5 MB. Larger files may lag the browser tab — use a streaming parser in Node.js for gigabyte-sized data.

+Does it support nested objects?

No — CSV is inherently flat. If your JSON needs nesting, do a post-processing pass in code.

+Are numbers converted to numeric type?

No, values remain strings. That preserves leading zeros in IDs and phone numbers. Convert with JSON.parse or Number() afterwards if needed.

Turning rows and commas into nested structure

CSV looks like the simplest data format in existence until you hit a field containing a comma, a quote, or a newline, at which point RFC 4180's escaping rules — largely ignored by half the tools that export CSV in the wild — become the difference between a clean conversion and silently shifted columns.

Converting to JSON is usually the first step toward feeding spreadsheet exports into an API, a database seed script, or a JavaScript app that expects structured objects rather than a flat table, and getting the edge cases right up front avoids a corrupted dataset discovered much later downstream.

Quoting rules that most exports get wrong

A field containing a comma or a newline must be wrapped in double quotes, and a literal double quote inside that field must be escaped by doubling it, so a value like He said "hi" becomes "He said ""hi""" in a properly formatted CSV. Plenty of tools — especially quick scripts that just join fields with commas — skip this entirely, producing files that look fine in a spreadsheet but break any parser that follows the actual spec, this converter included.

Type inference is a judgment call, not a fact

CSV has no native types — every value is a string until something decides otherwise. Converting 007 to JSON as a number silently drops the leading zero, which is disastrous for zip codes, product SKUs, or phone numbers, while converting a column of true/false strings to booleans might be exactly what downstream code expects. Whether numeric-looking strings should become JSON numbers is a decision worth making deliberately rather than accepting a default that seems convenient until it corrupts your first zip code column.

Headers, nesting, and the flat-file ceiling

CSV is inherently flat — one row, one record, no nested objects or arrays — so converting to JSON with dotted header names like address.city and address.zip is a common convention for reconstructing nested structure, but it only works if every tool in the pipeline agrees on that dot-notation convention. If your source CSV lacks a header row entirely, make sure the tool lets you supply column names explicitly rather than guessing generic names from the first data row, which would then get treated as a header by mistake.

Delimiter variations beyond the comma

Despite the name, plenty of real-world exports use semicolons instead of commas, especially from locales where the comma is already the decimal separator, and some use tabs to sidestep the escaping problem entirely. A converter that hardcodes comma as the only delimiter will silently produce a single-column JSON array of full row strings on a semicolon-delimited file, which is an easy mistake to miss if you don't check the output shape before trusting it.

Encoding and the byte-order-mark surprise

CSV files exported from spreadsheet software on Windows often include a UTF-8 byte-order-mark at the very start of the file, which is invisible in most editors but shows up as an extra character glued onto the first header name once parsed. Stripping or ignoring that BOM is a small detail that saves you from debugging why your first JSON key looks correct everywhere except for a stray character no one can see.

People also search for

  • csv to json converter
  • convert csv file online
  • csv parser tool
  • csv to json array
  • csv delimiter converter
  • spreadsheet to json
  • csv escaping rules
  • convert excel export to json