CSV to JSON Converter

Convert CSV data back to JSON format. Handles quoted fields and custom delimiters.

Input
Delimiter:
Output

How to Convert CSV to JSON

  1. Paste your CSV data into the input panel on the left. The first row should contain column headers that will become JSON keys.
  2. Select the delimiter — choose comma, tab, semicolon, or pipe to match your file’s format. Comma is the default for standard CSV files.
  3. Click “Convert” to transform the CSV into a JSON array of objects. Each row becomes one object in the array.
  4. Review the JSON output in the right panel. Keys come from your header row, and values are the corresponding cell data.
  5. Download or copy — click “Download” to save as a .json file, or use the copy button to paste into your code editor or API tool.

What is CSV to JSON Conversion?

CSV to JSON conversion transforms flat, tabular data (Comma-Separated Values) into structured JSON arrays that can be consumed by APIs, JavaScript applications, databases, and modern web services. CSV is one of the oldest and most widely supported data formats — every spreadsheet application, database, and programming language can read it — but it lacks the ability to express nested structures, data types, or metadata that JSON provides.

This converter reads your CSV, uses the first row as column headers, and produces a JSON array where each subsequent row becomes an object with key-value pairs. The result is clean, well-formatted JSON ready for use in web applications, REST APIs, or data processing pipelines. After converting, you can format the JSON for readability or explore it in the JSON Viewer.

Examples

1. Simple CSV to JSON array

A standard CSV file with headers:

name,age,city
Alice,30,London
Bob,25,Paris
Charlie,35,Berlin

Converts to:

[
  { "name": "Alice", "age": "30", "city": "London" },
  { "name": "Bob", "age": "25", "city": "Paris" },
  { "name": "Charlie", "age": "35", "city": "Berlin" }
]

2. CSV with quoted fields

Fields containing commas or special characters are correctly handled when wrapped in double quotes:

company,address,employees
"Acme, Inc.","123 Main St, Suite 4",250
"O'Brien Corp","456 Oak Ave",180

Output:

[
  { "company": "Acme, Inc.", "address": "123 Main St, Suite 4", "employees": "250" },
  { "company": "O'Brien Corp", "address": "456 Oak Ave", "employees": "180" }
]

3. Tab-delimited data

Select the Tab delimiter for TSV files exported from spreadsheets:

product	price	stock
Widget	9.99	150
Gadget	24.99	75
Doohickey	4.99	300

The tool produces the same clean JSON array regardless of the delimiter used.

Common Use Cases

  • Importing spreadsheet data into web apps: Export data from Excel or Google Sheets as CSV, then convert to JSON for your JavaScript frontend or Node.js backend.
  • Database seeding: Convert CSV data exports into JSON format for use with database seed scripts, MongoDB imports, or Firestore batch writes.
  • API request bodies: Transform tabular data into JSON arrays for POST requests to REST or GraphQL APIs.
  • Data migration: Convert legacy CSV data from older systems into JSON for modern applications and microservices.
  • Testing and prototyping: Quickly generate JSON test data from simple CSV tables you create in a text editor or spreadsheet.
  • Configuration generation: Turn simple CSV lookup tables into JSON config objects. Convert the result to YAML using the JSON to YAML converter for Kubernetes or Docker configs.
  • Data visualization prep: Convert CSV datasets to JSON for charting libraries like D3.js, Chart.js, or Recharts that expect JSON input.

Frequently Asked Questions

Does it handle quoted fields correctly?

Yes. The parser follows RFC 4180 conventions: fields wrapped in double quotes can contain commas, newlines, and escaped quotes (represented as two consecutive double quotes). For example, a field like “Smith, John” is correctly parsed as a single value.

What about headers?

The first row of your CSV is automatically treated as the header row. Each header value becomes a JSON key. If your CSV has no header row, the tool uses the first data row as keys, so you may want to add a header row manually before converting.

Can it detect the delimiter automatically?

Currently you need to select the delimiter manually using the buttons above the editor. The tool supports comma, tab, semicolon, and pipe delimiters. If you are unsure, look at the raw text — tabs appear as whitespace gaps, semicolons and pipes are visible in the data.

What encoding does it support?

The tool reads input as UTF-8 text, which covers virtually all modern CSV files. If you have a file in a legacy encoding like Windows-1252 or ISO-8859-1, convert it to UTF-8 first using a text editor or command-line tool like iconv.

How does it handle missing values?

Empty cells in the CSV are converted to empty strings in the JSON output. If a row has fewer columns than the header, the missing fields are set to empty strings. Rows with more columns than the header have the extra values ignored.

Can I convert the JSON output to other formats?

Yes. After converting CSV to JSON, you can use the JSON Formatter to clean up the output, the JSON to YAML converter for config files, or the JSON to Table tool to render the data as a sortable, editable table.

Privacy & How It Works

This CSV to JSON converter runs 100% in your browser. When you click Convert, the tool splits your CSV text by the selected delimiter, extracts the header row as keys, and maps each subsequent row into a JSON object. The resulting array is serialized with JSON.stringify() and displayed in the output panel. No data is sent to any server, no analytics track your input, and nothing is stored after you close the tab. The download feature creates a client-side Blob URL to generate the .json file entirely on your device. This makes it safe for converting sensitive business data, customer records, and internal datasets.