CSV to JSON

Convert CSV to JSON format


CSV to JSON

This online CSV to JSON converter allows you to easily convert CSV (Comma-Separated Values) data to JSON (JavaScript Object Notation) format. 

How To Use

Enter you data and select the conversion options:

  • Enter CSV Data: Input or paste your CSV data into this text field.
  • CSV Keys: Choose whether the first row in the entered CSV data contains column names ("keys"). Options include:
    • "Use the first row as keys": Utilize the first row as key names for the JSON objects.
    • "Don't use keys": The first row contains data.
  • JSON Format: Select the format of the output JSON data:
    • "Pretty": Human-friendly format with indentation and line breaks.
    • "Compact": Minimized format without extra spacing.

Click on the “Convert to JSON” button to initiate the conversion process and transform CSV data into JSON based on the selected options.

What is CSV

CSV, or Comma-Separated Values, is a simple file format used to store tabular data (numbers and text) in plain text. Each line of the file represents a data record, and each record consists of one or more fields, separated by commas.

What is JSON

JSON, or JavaScript Object Notation, is a lightweight data-interchange format. It is easy for humans to read and write and easy for machines to parse and generate. JSON data is represented as key-value pairs and is often used for structured data and data exchange between a server and a web application.

How to Represent CSV Data in JSON Format

Each row in the CSV becomes a JSON object or a JSON array.

If "Don't use keys" is selected, each CSV row will be represented by an array of values. For example: 

  • CSV Data:
John, 28, New York
Alice, 22, San Francisco
Bob, 35, Chicago
  •  JSON Output::
[
  ["John", "28", "New York"],
  ["Alice", "22", "San Francisco"],
  ["Bob", "35", "Chicago"]
]

If "Use the first row as keys" is selected, each row will be structured as an object with key-value pairs, where keys are taken from the first row of the CSV data. For example:

  • CSV Data:
Name, Age, City
John, 28, New York
Alice, 22, San Francisco
Bob, 35, Chicago
  • JSON Output:
[
  {
"Name": "John",
"Age": "28",
"City": "New York"
  },
  {
"Name": "Alice",
"Age": "22",
"City": "San Francisco"
  },
  {
"Name": "Bob",
"Age": "35",
"City": "Chicago"
  }
]


Contact

Missing something?

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

Contact Us