فارسی

Convert CSV to JSON (and Back)

Convert CSV to JSON and back. The separator is detected for you, and quotes or line breaks inside cells survive the trip. Everything runs in your browser.

Use this tool in your browser without installing software.

About this tool

Spreadsheets save their tables as CSV, while apps and APIs usually want JSON. This page converts both ways: it reads the CSV, takes the first row as the column names, and turns every row into an object; on the way back it writes a JSON array as a table again. It finds the separator for you — comma, semicolon, tab or pipe — because a spreadsheet set to a Persian or European locale often saves with a semicolon. A comma, a quote or a line break inside a cell comes back exactly as it went in. Nothing is uploaded or stored.

How to use it

  1. 1

    Open a CSV file or paste its text into the box. The separator is detected for you; if it guesses wrong, pick another one above.

  2. 2

    Leave the header option on when the first row holds the column names. The result is built as you type.

  3. 3

    Copy the result or download the JSON file. To go back, press the reverse button so the same data is read the other way.

Frequently asked questions

It guessed the wrong separator. What now?

Pick one yourself from the separator menu: comma, semicolon, tab or pipe. Persian and most European spreadsheet setups save with a semicolon, so a file that looks comma-separated may actually be split on «;».

Why are the numbers quoted in the JSON?

By default every value stays text, because phone numbers and postcodes start with a zero and would lose it as numbers. If a column really is numeric, turn on “Detect numbers and true/false”.

Persian or accented letters look broken in Excel.

The file has to be saved and opened as UTF-8. In Excel choose “CSV UTF-8” when saving, not “CSV (Comma delimited)”. For the file this page builds, the “Excel-friendly” option solves the same problem.

What happens to an empty or repeated column name?

An empty header gets a numbered name, and a repeated one gets a suffix, such as price and price_2. The notes under the input say which column changed so you can use the right name in your code.

What about nested values?

CSV has no nested cells. An object or array inside a row is written as JSON text in that cell and stays text on the way back. If you need the original structure, keep the data as JSON.

Why are some cells wrapped in quotes?

When a cell contains the separator, a quote or a line break, CSV wraps it in quotes so the cell borders stay clear. It is part of the format, not a change to your data; Excel shows the same text.