EveryToolAI
Index

CSV to JSON Converter

This converter turns CSV into JSON and JSON back into CSV. Paste CSV with a header row and get a clean array of objects keyed by your column names; paste an array of objects and get properly quoted CSV ready for a spreadsheet. It uses a real CSV parser rather than splitting on commas, and everything runs in your browser — no upload.

updated

Output
[
  {
    "name": "Ada",
    "role": "engineer"
  },
  {
    "name": "Alan",
    "role": "scientist"
  }
]

Why splitting on commas does not work

CSV looks like the simplest format in computing and is not. The moment a value contains a comma, the naive approach — split each line on commas — puts it in the wrong column and silently shifts every field after it. Addresses, product descriptions, names written surname-first and any free-text note all contain commas routinely.

The format's answer is quoting. A field containing a comma is wrapped in double quotes, and a double quote inside a quoted field is written twice. So "Smith, Jane" is one field, and a field containing a literal quote appears as """quoted""". A quoted field may also contain a newline, which means a single record can span several lines of the file — the reason line-by-line processing of CSV breaks on real exports.

This tool uses Papa Parse, a full CSV parser that implements all of that. It handles quoted commas, escaped quotes and embedded newlines correctly, so a spreadsheet export with addresses in it converts properly rather than shifting every column from the first comma onward. When the input is genuinely malformed you get a clear error naming the row, rather than plausible-looking but wrong output.

A worked example

The header row supplies the keys; each subsequent row becomes one object. Note what happens to the quoted field:

CSV to JSON, with a comma inside a value
name,role,city
Ada,engineer,London
"Smith, Jane",designer,Paris

->

[
  { "name": "Ada",         "role": "engineer", "city": "London" },
  { "name": "Smith, Jane", "role": "designer", "city": "Paris"  }
]

Converting that JSON back produces the original CSV, quotes and all — the round trip is faithful. Going the other way, the JSON must be an array of objects; a bare object, a nested structure or an empty array is rejected with an explanation rather than guessed at.

One conversion detail is worth knowing: every CSV value arrives as a string, because CSV has no types. The number 42 in a spreadsheet becomes "42" in the JSON, and a column of true and false becomes strings too. If the receiving system needs real numbers or booleans, cast them after conversion — this tool will not guess, because guessing is how leading zeros disappear from postcodes and product codes.

What is usually in the file you are converting

CSV is the format data leaves systems in. It is what you get when you export from a CRM, download a report, pull a mailing list, or receive a spreadsheet from a supplier — which means the file on your clipboard is very often a list of real people.

Customer names and email addresses. Order histories with addresses attached. Employee records. Survey responses. Payment references. This is the raw material of most data-protection regimes, and pasting it into a web tool that processes it server-side is a transfer of personal data to a third party — one that, under GDPR and similar regimes, you would be expected to have a basis and a processor agreement for.

Almost nobody thinks of it that way, because it feels like using a text editor. But the practical distinction between emailing a customer list to an unknown company and pasting it into their website is smaller than it feels.

Doing the conversion in the browser removes the question. The parse happens in your tab, the output is generated there, and nothing is transmitted — so a customer export converted here never becomes anyone else's problem. Verify it the same way as anywhere: Network tab, or Wi-Fi off.

Edge cases worth knowing

Everything is a string. CSV carries no type information, so numbers, booleans and dates all arrive as text and must be cast deliberately if the destination cares. This is a feature more often than it looks — automatic type detection is what turns the postcode 01234 into the number 1234.

Duplicate column names collide. Two columns called name produce one key in each object, because JSON objects cannot hold the same key twice, and the later value wins. Rename them in the source before converting if both matter.

Empty values become empty strings rather than null, and a missing trailing field is treated as empty rather than as an error. Blank lines are skipped instead of producing empty objects.

Very large files are limited by your device's memory, since the whole conversion happens there — a few tens of thousands of rows is comfortable, and a multi-gigabyte export is a job for a streaming tool on your own machine rather than for any web page. Excel's regional settings are also worth watching: in locales that use a comma as the decimal separator, Excel exports semicolon-delimited files, which are not CSV in the sense this tool expects.

Frequently asked questions

Does it handle commas inside quoted fields?

Yes. It uses a full CSV parser, so a quoted value like "Smith, Jane" stays in one column instead of splitting and shifting every field after it. Escaped quotes and newlines inside quoted fields are handled correctly too — these are the cases naive comma-splitting gets wrong.

What JSON shape does CSV produce?

An array of objects, one per data row, with keys taken from the header row. Converting that array back to CSV reproduces the original structure and quoting, so the round trip is faithful.

Why are my numbers strings in the JSON?

Because CSV has no types — every value in the file is text, and this tool does not guess. That is deliberate: automatic type detection is what silently turns the postcode 01234 into 1234. Cast the fields you need after converting.

Is my data uploaded to a server?

No. Parsing and conversion run entirely in your browser. This matters more than for most tools, because a CSV is usually an export of real people — customers, employees, survey respondents — and sending that to a third-party service is a personal-data transfer regardless of how casual it feels.

What happens if two columns have the same name?

They collide, and the later one wins, because a JSON object cannot hold the same key twice. If both columns matter, rename one in the source spreadsheet before converting.

My Excel export won't convert. Why?

Check the delimiter. In locales that use a comma as the decimal separator, Excel exports semicolon-separated files by default, which are not CSV in the sense this tool expects. Re-export choosing comma-separated, or replace the delimiters first.

Related tools