Skip to content

Converter Tools

CSV to JSON

Turns spreadsheet-style rows and columns into structured JSON, using the first row as your object keys. Handles quoted cells, other separators, and real numbers.

  • Free
  • No sign-up
  • Runs in your browser

Guide

How CSV maps to JSON

CSV (comma-separated values) is a plain text table. Each line is a row, a separator character splits the cells, and usually the first line holds the column names. JSON represents the same information as a list of objects, where each object is one row and the column names become its keys.

This tool reads the CSV properly, following the common rules: a cell wrapped in double quotes can contain commas, line breaks and quote marks (written as two quotes in a row). So "Doe, Jane" stays one cell, and "He said ""hi""" becomes He said "hi". The result is printed with two-space indentation.

CSV itself has no data types, so the tool offers to guess them: with Convert numbers and true/false ticked (the default), 32 becomes the number 32 and true becomes a real boolean. Values that only look like numbers, such as the zip code 007 or 1e3, stay text so no information is lost. Untick the option to keep every value as text.

Why people convert CSV to JSON

Spreadsheets and database exports commonly come as CSV, while web applications, APIs and scripts expect JSON. Typical cases include preparing sample data for a front-end prototype, seeding a database with a few rows, or seeing what a spreadsheet export would look like as structured data.

It suits small jobs where writing a parser would be overkill: paste the table, copy or download the result, move on. If your data starts in a workbook, the Excel to CSV converter can produce the CSV first.

How to convert CSV to JSON here

  1. Paste or type your CSV into the CSV box. A small sample is loaded, so you can replace it.
  2. Choose the Separator that your file uses: comma, semicolon, tab or pipe. Many European spreadsheet exports use semicolons.
  3. Leave First row is the header ticked if the first line holds column names. Untick it and each row becomes a plain list of values instead.
  4. Read the result in the JSON box, which updates live, then click Copy or Download .json.

There is no file upload, so paste your data in. The conversion runs in your browser and nothing is sent to a server. If a quoted cell is missing its closing quote, an error message tells you.

Behavior worth knowing

A few details explain what you will see in the output:

  • Short rows get empty strings for missing cells, and cells beyond the header count are dropped.
  • Duplicate or empty column names are made unique (name, name_2) or named column1, column2 and so on, so no data is overwritten.
  • Blank lines are skipped, and a leading byte-order mark from a spreadsheet export is ignored.
  • Spaces inside cells are kept exactly as written, apart from the number and true/false detection.

Check the output against your source for anything important. To go the other way, use JSON to CSV, and the JSON formatter if you want to reindent the result.

Frequently asked questions

Can it handle quoted values containing commas?

Yes. A cell in double quotes can contain commas, line breaks and quote marks, following the standard CSV rules. "Doe, Jane" is read as a single cell.

Why is my zip code 007 still in quotes while other numbers are not?

Values with leading zeros, exponents or plus signs are kept as text, because turning them into numbers would change them. Plain numbers such as 32 or 3.5 become real JSON numbers. Untick the option to keep everything as text.

My file uses semicolons or tabs. Does it work?

Yes. Pick the matching separator from the dropdown: comma, semicolon, tab or pipe.

Does the first row have to be a header?

No. By default the first line supplies the object keys, but you can untick the header option and each row becomes a list of values.