CSV to JSON

Why splitting on commas fails

CSV looks like it can be parsed with one line of code, and it can — right up to the first row that contains an address, a company name with a comma in it, or a quoted note with a line break. The format allows a field to be wrapped in double quotes, and inside those quotes commas, newlines and doubled quotes are all ordinary characters.

This parser follows those rules, so a row like 1,"Sharma, Priya","Flat 4, Noida",5000 reads as four fields rather than six.

Automatic typing is the setting to think about

Turning 42 into a number is usually right. Turning 0114567890 into a number is not — the leading zero disappears and a phone number becomes wrong. The same applies to PIN codes, account numbers and any ID that only looks numeric. Switch typing off when the file has those in it.

Empty is not the same as missing

An empty cell can become "", null, or be left out of the object altogether. These behave differently in whatever reads the JSON — a missing key and a null value are distinguishable, and some validators care. It is offered as a choice because there is no answer that is right for every case.

Going the other way

Converting JSON to CSV means flattening, and the columns are collected from every key that appears anywhere in the array rather than just the first object. Rows that lack a key get an empty cell instead of a shifted row.

Share this tool with friends

Free to use, no sign-up, works on any phone.

Frequently Asked Questions

Does it handle commas inside a field?

Yes. A field wrapped in double quotes may contain commas, line breaks and doubled quotes, and all three are parsed correctly. Splitting a CSV on commas is the classic mistake — it works until one row contains an address.

What if my file uses semicolons or tabs?

Choose the delimiter, or leave it on automatic and it is worked out from the first line. Semicolons are common in European exports because the comma is used as a decimal separator there.

Are numbers converted or kept as text?

Your choice. Automatic typing turns 42 into a number and true into a boolean, which is usually what you want for an API. Leave it off when values only look numeric — phone numbers, PIN codes and IDs with leading zeros are ruined by being read as numbers.

What happens to an empty cell?

It becomes an empty string, or null if you prefer. They are not the same thing to whatever consumes the JSON, so it is offered as a choice rather than decided for you.

Can it go the other way?

Yes. Paste an array of objects and it produces CSV, with the columns taken from every key that appears across all the rows so nothing is dropped when the objects differ.

Is my data uploaded?

No. Parsing happens in your browser, which matters because CSV exports are usually customer or transaction data.

Everything on this page runs inside your own browser. Nothing you type or upload is sent to a server, so your data never leaves your device.