CSV to JSON Converter

Convert CSV to JSON formats in seconds.

About CSV (Comma-Separated Values)

CSV is a plain text format that stores tabular data (numbers and text) in plain text. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separator is the source of the name for this file format.

A CSV file typically stores tabular data (numbers and text) in plain text, in which case each line will have the same number of fields. The first line often contains the headers or column names.

Example:
name,age,city
Alice,30,New York
Bob,24,Paris
Charlie,35,London

About JSON (JavaScript Object Notation)

JSON is a lightweight data-interchange format. It is easy for humans to read and write, and easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others.

These properties make JSON an ideal data-interchange language. For representing CSV data, JSON is typically structured as an array of objects, where each object represents a row and its properties represent the columns.

Example (from above CSV):
[
  {
    "name": "Alice",
    "age": "30",
    "city": "New York"
  },
  {
    "name": "Bob",
    "age": "24",
    "city": "Paris"
  },
  {
    "name": "Charlie",
    "age": "35",
    "city": "London"
  }
]

How to Use This Converter

  1. Select Mode: Click "CSV to JSON" or "JSON to CSV" to choose your desired conversion direction. The input and output labels will update accordingly.
  2. Enter Data: Paste or type your data into the input text area on the left.
    • For CSV to JSON: Ensure the first line contains comma-separated headers, and subsequent lines contain comma-separated values.
    • For JSON to CSV: Provide a valid JSON array of objects. All objects should ideally have the same keys to produce a consistent CSV.
  3. Convert: Click the "Convert" button (e.g., "Convert CSV to JSON").
  4. View Result: The converted data will appear in the output text area on the right.
  5. Copy or Clear: Use the "Copy" button above the output area to copy the result to your clipboard. Use "Clear All" to reset both input and output fields.
  6. Error Handling: If there's an issue with your input format, an error message will appear below the text areas.