CSV to JSON Converter

Convert a CSV file into a JSON array of objects. Choose the delimiter and whether the first row is a header, then copy or download the result. Everything runs in your browser — nothing is sent to a server.

Delimiter
Use first row as header
Pretty-print (with indentation)


            
            Copied!
            
          

Enter some CSV to see the JSON output here.

How a CSV row maps to a JSON object

A CSV row name,age,city
The resulting JSON object {"name": "...", "age": "...", "city": "..."}

When the first row is used as a header, each subsequent row becomes an object keyed by the header's column names.

What CSV to JSON conversion is

Converting CSV to JSON means turning comma-separated data into a JSON array — an array of objects — that a program can work with directly. The parser follows RFC 4180, so it handles commas, line breaks and escaped quotation marks ("") that appear inside double-quoted cells. That means even the awkward CSV files that come out of Excel are converted without falling apart.

During conversion the first row is treated as the header row, and each row from the second onwards becomes an object in the form of "column name: value". Everything is done by JavaScript inside your browser, so the CSV you paste in is never sent to a server.

How to convert CSV to JSON

  1. Enter your CSV Paste the CSV into the text area or type it in directly. If you have no data at hand, the sample button loads an example.
  2. Pick the delimiter Use the delimiter setting to say whether your data uses commas or tabs. Choose tab for a TSV file.
  3. Set how the header row is handled Turn on the option that treats the first row as a header and the values in that row become the key names of the JSON objects.
  4. Choose the output style Toggle the indented display to switch between readable JSON with indentation and compact JSON with the whitespace stripped out.
  5. Copy the result The converted JSON appears on screen automatically. Use the copy button to put it on the clipboard and use it as it is.

Tips for getting more out of it

  • With "Use first row as header" enabled, the first row's values become the JSON object's keys. Disable it to get generic col1, col2… keys instead.
  • If the header has blank or duplicate column names, that column automatically falls back to a col{N} key so no value is lost.
  • Pair this with the sister "JSON to CSV" tool to convert back and forth between CSV and JSON as many times as you need.
  • Conversion uses an RFC 4180–compliant parser that correctly handles commas, line breaks, and escaped quotes ("") inside quoted cells, so complex CSV files exported from Excel convert correctly too.

When CSV to JSON conversion is useful

Building test data for an API

Take a CSV exported from a spreadsheet and turn it quickly into the JSON payload you need for checking that an API behaves correctly.

Preparing data to load into a NoSQL database

Document-oriented databases such as MongoDB work with JSON, so a list built in a spreadsheet can be converted straight into loadable data.

Creating mock data for the front end

Prepare the JSON array you need for dummy screens and tests in short order, starting from a list you put together in Excel.

One-off conversions without writing a script

It is just as handy for a single small CSV to JSON conversion that hardly justifies writing conversion code on the spot.

Terms used here

CSV
Short for Comma-Separated Values, a format that represents tabular data by separating values with commas. It is widely used for reading and writing in spreadsheet software.
JSON
Short for JavaScript Object Notation, a lightweight format that represents data mainly through pairs of keys and values. Most programming languages and APIs handle it as a matter of course.
TSV
Short for Tab-Separated Values, a format that represents tabular data by separating values with tab characters. Its boundaries are less likely to become ambiguous than CSV when the values themselves contain commas.
RFC 4180
The specification that sets out the common format of a CSV file. It defines how commas, line breaks and quotation marks are handled inside cells enclosed in double quotes.
Header row
The row placed first in a CSV, giving the name of each column. When converting to JSON, the values in this row become the key names of the objects.
Escaping
When you want a double quotation mark itself to be part of a value in a CSV, you write it twice (""). The parser restores that back into a single double quotation mark.

FAQ

By default, the first row is treated as a header, and each following row becomes an object like {"header": "value", ...}; all of those objects are collected into a JSON array. This is a common shape for API responses and for loading data into NoSQL databases.

Yes — just set "Delimiter" to "Tab" and a TSV file will convert to JSON the same way a CSV does.

Yes. Every value in a CSV is plain text, so numbers and booleans are output as JSON strings (e.g. "123" or "true") rather than actual numbers or booleans. If you need real numeric types, convert them on the JSON side after export.

No. All conversion happens in JavaScript inside your browser, and the CSV content you enter is never sent anywhere. It's safe to use with data that contains personal or confidential information.
Tool-kun

Side Note — Why APIs prefer JSON over CSV

CSV is great at representing flat, tabular data, but it can't express nested structures like arrays or nested objects. Most REST API responses use JSON precisely because a single record can freely embed arrays and objects — letting complex data structures that CSV simply can't express travel over the wire intact.

CSV still has advantages that are hard to give up: it opens instantly in Excel or a spreadsheet, and one row per record makes it easy for a human to eyeball. In practice, teams settle into "CSV for reporting and spot-checking, JSON for system-to-system integration" — which is exactly why a converter like this one stays useful.

Despite its name — JavaScript Object Notation — JSON is now supported as a standard data format in virtually every language, not just JavaScript. Since Douglas Crockford published the specification in 2001, it was deliberately designed as a minimal, language-independent way to represent data, which is a large part of why it spread so widely.