jsonecho

CSV to JSON

Turn CSV into an array of JSON objects, with the first row as the keys.

Loading the tool...

How to use CSV to JSON

  1. Paste your CSV or upload a .csv file.
  2. Turn off "First row is header" if your data has no header, or "Detect numbers" if you need text only.
  3. Copy the JSON.

About CSV to JSON

Most data sits in a spreadsheet at some point, and most APIs want JSON. The first row of your CSV is used as the key names, and each following row becomes one object in an array. The delimiter is detected automatically, so comma, semicolon, tab and pipe files all work.

Quoted fields are handled the way the CSV standard defines: a comma or a line break inside quotes is part of the value, and two double quotes in a row stand for one. Numbers are recognised and written as numbers unless you turn that off, for example when you need to keep leading zeros.

Frequently asked questions

The delimiter is a semicolon, will it work?

Yes, the delimiter is detected automatically. Comma, semicolon, tab and pipe are all recognised.

How do I keep leading zeros, like in postal codes?

Turn off "Detect numbers". Every value then stays a string, so 01234 remains 01234.

What if my CSV has no header row?

Untick "First row is header". You get an array of arrays instead of objects.

Does it handle Excel exports with a BOM?

Yes, the byte order mark at the start of the file is removed before parsing.

Why are some rows missing?

Completely empty lines are skipped. If other rows are missing, check for an unclosed quote earlier in the file, which makes the parser read several lines as one value.

More in Converters

All tools →