CSV to JSON Converter

CSV is what spreadsheets export; JSON is what APIs and applications consume. This converts between them in both directions - CSV becomes an array of objects keyed by the header row, and JSON flattens back into rows.

The conversion runs locally, which matters because CSV exports are so often customer lists, transactions or exported reports.

Free · runs in your browser · updated

Input
Direction
Output

CSV to JSON Converter at a glance

What it does
Convert CSV to a JSON array of objects, or JSON back to CSV, entirely in your browser. Handles headers, quoting and embedded commas.
Where it runs
Entirely in your browser — no data is uploaded
Works offline
Yes, once the page has loaded
Cost
Free, with no account and no usage limit
Category
Converters

How to use the converter

  1. Paste your CSV, keeping the header row - it becomes the object keys.
  2. Convert to JSON and check the first record looks right.
  3. Or paste JSON - an array of objects - and convert the other way.
  4. Copy the output into your code, API request or import tool.

What the output looks like

A CSV with a header row becomes an array of objects, one per data row:

name,role,active
Ada,engineer,true
Grace,admiral,true

→

[
  { "name": "Ada",   "role": "engineer", "active": "true" },
  { "name": "Grace", "role": "admiral",  "active": "true" }
]

Note that true arrives as a string. CSV has no types - everything in the file is text - so numbers and booleans need converting after parsing unless a tool guesses, and guessing causes its own problems.

Commas, quotes and the rules that trip people up

CSV looks trivial and is not. There is no single specification; RFC 4180 describes the common conventions, and plenty of software ignores parts of it.

  • A field containing a comma must be quoted: "Smith, John".
  • A quote inside a quoted field is doubled: "She said ""hello""".
  • A field may contain newlines if it is quoted, which is why splitting a CSV on line breaks is wrong and produces mangled rows.
  • Leading and trailing spaces are significant unless the field is quoted, and different tools disagree about trimming them.

This is why writing your own CSV parser with split(',') works on your test file and fails on real data the first time someone's address contains a comma.

The Excel problems

Data that passes through Excel acquires a specific set of corruptions, and they are worth knowing about because they are silent.

  • Leading zeros disappear. A postcode of 01234 becomes 1234. Product codes and phone numbers suffer the same way.
  • Long numbers become scientific notation. A 16-digit identifier turns into 1.23457E+15, losing its final digits permanently.
  • Text that looks like a date becomes one. The gene name SEPT2 famously became 2-Sep so consistently that the genetics community renamed the genes.
  • Separator varies by locale. Excel in much of Europe writes semicolon-separated files, because the comma is the decimal mark.
  • UTF-8 without a byte-order mark opens as mojibake in Excel on Windows, which is why exports often carry a BOM.

The reliable fix is to import rather than open: use Excel's text import and mark identifier columns as Text, or handle the file with a real CSV library instead.

Nested data

JSON is a tree; CSV is a grid. Anything nested has to be flattened, and there is no standard way to do it. A common convention is dotted keys - address.city, address.postcode - which round-trips reasonably well.

Arrays are harder. A user with three tags either needs three columns, a single column of joined values, or three rows repeating the user. All three are lossy or awkward, which is the fundamental reason CSV is a poor transport for structured data. If you control both ends, send JSON.

Frequently asked questions

Yes, provided the field is quoted, which is the standard convention. Doubled quotes inside a quoted field are handled too.

Because CSV has no types - every value in the file is text. Automatic conversion would corrupt identifiers with leading zeros and postcodes, so values are kept as strings for you to convert deliberately.

Nested structures have to be flattened to fit a grid, typically with dotted column names. Arrays of varying length do not map cleanly to columns at all - if the data is genuinely nested, CSV is the wrong format.

No. Parsing and conversion happen in your browser, which is what makes this safe for customer exports and transaction data.

Common in European Excel exports, because the comma is used as the decimal separator there. Replace the separators before converting, or re-export with a comma delimiter.

Nothing you enter here leaves your browser

CSV to JSON Converter does its work in JavaScript running on your own device. The page loads once, and after that there is no upload step and no server involved — which matters here because exported data frequently contains customer records or transactions.

You can verify this rather than taking our word for it: load the page, disconnect from the internet, and the tool keeps working. Our privacy policy sets out what is and is not collected, and this guide explains why the distinction matters.