CSV to JSON Converter

Paste a CSV and get JSON. The separator is worked out for you, quoted fields are read properly, and nothing is quietly turned into a number unless you ask.

JSON


          
—Rows
—Columns
—Separator

How to use it

  1. Paste the CSV, or open the file in a text editor and copy it in.
  2. Leave the separator on automatic unless it guesses wrong.
  3. Read the note below before ticking the number box.

Why you cannot just split on commas

The first line of the example is "Sharma, Priya". Split that on commas and you get two columns where there should be one, every later column shifts left by one, and the row is quietly wrong — not broken enough to notice, just wrong.

A real CSV parser tracks whether it is inside quotation marks. Inside them, a comma is text. A doubled quotation mark is one literal quotation mark, which is how Anjali ""Anu"" comes back out as Anjali "Anu". A line break inside quotes is part of the field, not the end of the row. This page does all of that, which is the whole reason to use it rather than a one-line split.

The number box, and why it is off

Turning 1299 into a number is obviously right. The trouble is everything that only looks like a number.

  • A phone number 09876543210 becomes 9876543210. The leading zero is gone and so is the number.
  • A postcode or an order reference beginning with zero loses it the same way.
  • An identifier longer than about sixteen digits cannot be held exactly at all, and the last digits change.
  • 1e5, a perfectly good product code, becomes 100000.

Every one of those is silent. So the default here is to leave everything as text, which is never wrong, and let you turn detection on when you know your columns. When it is on, this page still refuses to convert anything with a leading zero, for the reason above.

What happens to awkward headers

An empty heading becomes column2, numbered by position. A heading that appears twice gets a number added to the second one, because a JSON object cannot hold the same key twice and the second would silently swallow the first.

With the header box unticked, every row becomes an array instead of an object and nothing is named. That is the right choice when the file genuinely has no header row — otherwise your first row of real data disappears into the column names.

Frequently asked questions

Why is my phone number wrong?

Number detection is on and it removed the leading zero, because 09876543210 as a number is 9876543210. Untick that box - text is never wrong. This page refuses to convert leading-zero values even when detection is on, for exactly this reason.

Can it handle a comma inside a field?

Yes, as long as the field is in quotation marks, which is what the CSV convention requires. "Sharma, Priya" stays one field. So does a line break inside quotes.

What if my file has no header row?

Untick 'first row holds the column names' and each row becomes an array of values instead of an object. Leaving it ticked on a file with no header turns your first row of data into the column names.

Two of my columns have the same name. What happens?

The second one gets a number added - city becomes city2 - because an object cannot have the same key twice and the second value would otherwise replace the first without saying so.

Is there a row limit?

Nothing fixed, but everything is held in memory and shown on screen, so a file of hundreds of thousands of rows will make the tab slow. A few tens of thousands is comfortable.

Is my text sent anywhere?

No. Everything happens in JavaScript inside your own browser. Nothing is uploaded and nothing is saved - close the tab and it is gone.

Related tools