---
title: "How to convert CSV to JSON | ToolSugar"
description: "Convert CSV to a JSON array of objects, handle quoted commas and semicolon files, and understand why every value stays text."
canonical: https://toolsugar.com/blog/how-to-convert-csv-to-json
image: https://toolsugar.com/og.png
---

# How to convert a CSV file to JSON

Updated 2026-11-09

To convert CSV to JSON, use the first row as the keys and turn every other row into an object. CSV to JSON on ToolSugar does this in your browser. Choose the delimiter, decide whether row one is a header, and copy the array it builds.

[Open CSV to JSON](https://toolsugar.com/tools/csv-to-json)

## Convert CSV to JSON in four steps

Paste CSV text or open a .csv file. The JSON updates as you type.

1. Paste CSV into the CSV box, or open a .csv file.
2. Pick the Delimiter your file uses.
3. Choose whether the first row is a header or there is no header.
4. Copy the JSON, or press Download to save data.json.

## Pick the right delimiter

Comma, semicolon, tab and pipe are all available. Many European spreadsheet exports use semicolons because the comma is their decimal mark. If your output is one long key per row, the delimiter is wrong.

Quoted fields can hold the delimiter, doubled quotes and line breaks, because the parser follows RFC 4180. CRLF and LF line ends both work, and a leading byte order mark is ignored.

## With a header or without

With a header, you get an array of objects such as {"name": "Ana"}. Turn the header off and each row becomes a plain array of values.

Repeated header names get a number suffix, so a second a becomes a_2. An empty header becomes fieldN, where N is the column number.

## Why every value is a string

CSV has no types. A guess would turn 007 into 7 or 1E5 into 100000, and the original is gone. The tool keeps each value exactly as written.

Convert numbers and booleans in your own code, where you know which columns hold which type.

## Questions

### What happens when a row is shorter than the header?

The missing cells become empty strings. A row with extra columns gets fieldN keys, so every object ends up with the same keys.

### Can a CSV field contain a comma?

Yes, if the field is wrapped in double quotes. The comma stays inside the value and does not start a new column.

### Can I get the JSON as a file?

Yes. Press Download to save it as data.json, or copy the text to your clipboard.

[Open CSV to JSON](https://toolsugar.com/tools/csv-to-json)

## Related guides

- [How to convert JSON to CSV](https://toolsugar.com/blog/how-to-convert-json-to-csv)
- [How to format JSON online](https://toolsugar.com/blog/how-to-format-json)
- [How to convert YAML to JSON](https://toolsugar.com/blog/how-to-convert-yaml-to-json)
- [How to convert XML to JSON](https://toolsugar.com/blog/how-to-convert-xml-to-json)
