CSV To JSON

Convert CSV to JSON. Free CSV to JSON converter.

Comma, semicolon, tab or pipe separated, with or without quotes. Quoted cells may hold line breaks. The delimiter, the quote character and whether the first row holds the names are found for you; set them yourself when needed.

Rate this tool

How useful was this tool?

CSV to JSON Converter

Paste CSV into the box and click Convert to JSON. It can come from Excel, Google Sheets or any export: separated by commas, semicolons, tabs or pipes, with or without quotes.

The tool works out the delimiter, the quote character and whether the first row holds the column names, and tells you what it decided. If it guessed wrong, set any of them yourself under Delimiter, Quote Character and First Row.

A live preview shows the result with row and column counts. Copy the JSON, or download it as a .json file.

Your data stays on the page. Nothing you paste is stored.

Example

Here’s an export from a European Excel, which uses semicolons. It has a sep=; line at the top, a note containing both a semicolon and a line break, ZIP codes that start with zero, very long order numbers and one empty cell:

sep=;
order_id;name;active;score;address.city;address.zip;note
9007199254740993;Maria Silva;true;4.5;Boston;02134;"Leave at door; ring twice"
9007199254740994;John Smith;false;;Amherst;01002;"Gift wrap
Card: Happy birthday!"

With JSON values and nested objects switched on, the result is:

[
  {
    "order_id": "9007199254740993",
    "name": "Maria Silva",
    "active": true,
    "score": 4.5,
    "address": {
      "city": "Boston",
      "zip": "02134"
    },
    "note": "Leave at door; ring twice"
  },
  {
    "order_id": "9007199254740994",
    "name": "John Smith",
    "active": false,
    "score": null,
    "address": {
      "city": "Amherst",
      "zip": "01002"
    },
    "note": "Gift wrapnCard: Happy birthday!"
  }
]

What happened:

  • The semicolon delimiter was detected. The sep=; line was used as a hint and left out of the data.
  • Quoted cells stayed whole. The semicolon inside the first note didn’t split it, and the second note kept its line break (written n in JSON).
  • Values got real JSON types. true and false became booleans, 4.5 a number, and the empty score null.
  • ZIP codes kept their leading zeros. As numbers, 02134 would turn into 2134, so they stay text.
  • The long order numbers stayed text. As numbers, most programs would change 9007199254740993 to 9007199254740992, because JavaScript and many other languages can’t store whole numbers that large exactly.
  • Dotted names became a nested object. address.city and address.zip were combined into one address object.

What the tool works out for you

Delimiter. The tool checks which character splits every row into the same number of columns: comma, semicolon, tab or pipe.

Quote character. Usually a double quote. Some systems use single quotes.

First row. If the first row looks like names rather than data, it’s used for the keys. If not, every row is treated as data.

The preview says what was decided. When a guess is wrong, for example a file whose first row really is data, change that setting and the result updates.

Values: JSON types or text

With Numbers, true/false and empty cells as JSON values, not text switched on:

  • Numbers become JSON numbers.
  • true and false become booleans.
  • Empty cells become null.

Some values look like numbers but aren’t, and these stay text: ZIP and postal codes with a leading zero, phone numbers starting with 0 or +, and IDs too long to store as exact numbers.

Turn the option off to get every value as text, exactly as it appears in the CSV, with empty cells as "". That’s the safer choice when the JSON goes into a system that expects strings, or when you want to decide the types yourself.

Nested objects from dotted column names

With Dotted column names become nested objects switched on, column names with dots build structure:

  • address.city and address.zip become "address": {"city": ..., "zip": ...}.
  • tags.0 and tags.1 become "tags": [..., ...].

That’s the reverse of what the JSON to CSV tool does when it flattens nested data, so a file can go from JSON to CSV, be edited in a spreadsheet, and come back as the same structure.

Switch it off if your column names simply contain dots, such as version.number meant as one name, and you want them kept as keys.

When the first row is data

If the CSV has no header row, set First Row to Data. Each row then becomes a plain array instead of an object:

[
  ["Boston", "02134"],
  ["Amherst", "01002"]
]

Messy files it handles

  • Line breaks and delimiters inside quoted cells. Addresses and notes stay in one value instead of breaking the row.
  • Excel’s sep= line, which some programs add to tell Excel which delimiter to use.
  • Byte order marks. Excel’s “CSV UTF-8” format adds an invisible marker at the start of the file. Many converters then name the first column "ufeffid" instead of "id", so code looking for id finds nothing. This tool removes it.
  • Blank lines, which are skipped.
  • Uneven rows. If a row has fewer or more cells than the header, it’s still included rather than silently dropped, and the tool tells you which rows were affected. A row that’s too short usually means an unclosed quote or a missing delimiter in the original file.

Getting CSV out of a spreadsheet

The quickest way: select the cells in Excel or Google Sheets, copy them, and paste here. Spreadsheets copy cells as tab-separated text, and the tool detects the tabs.

To save a file instead:

  • Excel: File > Save As and choose CSV UTF-8 (Comma delimited). The plain “CSV” option can garble accented letters.
  • Google Sheets: File > Download > Comma-separated values.

FAQ

What’s the difference between pretty and compact output?

Pretty print adds line breaks and indentation so the JSON is easy to read. Compact output puts everything on one line, which is smaller and better for sending to an API or storing. Both contain exactly the same data.

Why are some numbers in quotes?

They’re values where converting to a number would change them: leading zeros, phone numbers or very long IDs. Switch off JSON values to get every value as text, or edit the result if you know a column should be numeric.

Can I convert JSON back to CSV?

Yes, with JSON to CSV. For tab-separated files, there’s also TSV to JSON.

How do I check the JSON is valid?

The output is always valid JSON. If you edit it afterwards, check it with the JSON Validator, or browse it as a tree in the JSON Viewer.

Is my data stored anywhere?

No. Everything stays on the page, and nothing you paste is stored.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us