CSV to JSON Converter

A CSV file is the simplest way to move tabular data between programs. Spreadsheets export it, databases dump it, and surveys download it. But web apps and APIs speak JSON, not CSV. That gap is why a CSV to JSON converter is one of the most used small tools on the web: it takes rows and columns and turns them into the named objects that code can read directly, without anyone retyping the data by hand.

This converter runs fully in your browser. Paste CSV text into the box, or choose a CSV file from your device, pick the separator, and press Convert to JSON. If the first row holds column names, leave the header box ticked and those names become the keys of each object. If not, the tool names the columns col1, col2, and so on. The result appears below the button, and you can download it as a data.json file ready to use.

Here is a worked example. Suppose you export a small contact list with the header name,age,city and two rows, Ana,28,Madrid and Luis,34,Sevilla. Paste it in, keep the comma separator, and convert. The output is a JSON array with two objects: the first has name Ana, age 28, and city Madrid, and the second has name Luis, age 34, and city Sevilla. A developer can now load that array in code and loop over it, instead of splitting text lines by hand.

Quoted values are handled the way real CSV files expect. If a cell contains a comma, such as an address like Calle Mayor, 12, the file wraps that cell in quotes, and a naive split on commas would break it in two. This parser respects quotes, so Calle Mayor, 12 stays one value. It also handles doubled quotes inside a quoted cell, and line breaks inside quoted cells, which appear in comment fields and multi-line addresses more often than people expect.

The separator choice matters more than it looks. Most English exports use a comma, but many European spreadsheets export with a semicolon, because the comma is already used as the decimal mark. If your conversion produces one giant column instead of several, the separator is almost always the cause: switch to semicolon and convert again. Tab-separated exports from some databases are covered too, with the Tab option in the same menu.

A note on data types: this tool keeps every value as text, including numbers like 28. That is deliberate, because CSV itself has no types, and guessing can corrupt data such as phone numbers with leading zeros or product codes like 007. If your code needs real numbers, convert the fields you need after loading the JSON. Keeping the original text intact means nothing is silently lost or rounded on the way through.

Practical uses are everywhere. A teacher can turn a class list into JSON for a small web page. A shop owner can convert an exported order list for a new plugin. A student can prepare survey answers for a chart library that only accepts JSON. Because the file never leaves your device, you can convert customer lists and internal data without uploading them to an unknown server, which is a real privacy advantage over many free converters.

Once the JSON is ready, test it before you hand it over. Open the downloaded file, count the objects, and compare the first and last rows against the original CSV. If a field looks empty, check whether the original cell was empty or whether a separator problem merged two columns. Catching that mismatch now takes a minute, while finding it later, after the data has been loaded into an app or a chart, takes far longer and can mean rebuilding work that depended on the broken rows.

Versión en español

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top