CSV to JSON Converter

Convert CSV data into a JSON array of objects, correctly handling quoted fields that contain commas, quotes or line breaks.

2Data rows
4Columns

Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.

What the CSV to JSON Converter does

Use this CSV to JSON converter to convert CSV data into a JSON array of objects, correctly handling quoted fields that contain commas, quotes or line breaks. Paste your text in, pick the options you need, and copy the result straight back out. It is most often used for converting a spreadsheet export into JSON for an API or application. We run a second free tools site as well — FreeToolStation.org.

How to use it

  1. Paste your CSV data, including the header row.
  2. Pick the delimiter if it is not a comma.
  3. Leave "first row contains column names" on to get an array of objects.
  4. Copy the JSON or download it.

How it works

The parser is a proper character-by-character state machine rather than a line split on commas. That is necessary because CSV allows a field to be wrapped in double quotes and to contain the delimiter, line breaks, and escaped quotes written as two double quotes in a row. Splitting on commas breaks on all three.

With the header option on, each row becomes an object keyed by the column names. With it off, each row becomes an array, which is what you want for positional data without headers.

Numeric conversion turns strings that look like numbers into actual JSON numbers, and true/false into booleans. Turn it off if your data has identifiers such as postcodes or phone numbers with leading zeros, which would be corrupted by conversion.

When to use it

  • Converting a spreadsheet export into JSON for an API or application.
  • Turning tabular data into fixtures for a test suite.
  • Inspecting a CSV in a structured format.

Common mistakes to avoid

  • Leaving numeric conversion on for identifiers with leading zeros, which get stripped.
  • Choosing the wrong delimiter for a European CSV, which often uses semicolons.
  • Assuming the first row is a header when it is actually data.

Frequently asked questions

Does it handle commas inside quoted fields?

Yes. The parser tracks quote state properly, so a field like "Wrote the first algorithm, in 1843" stays as one value. It also handles escaped quotes written as two double quotes.

Why are my postcodes losing leading zeros?

Numeric conversion is turning them into numbers. Turn that option off and all values stay as strings.

Related tools

See all developer tools →