CSV to JSON Converter

Paste CSV or upload a spreadsheet export to get a JSON array, with the header row used as keys. This CSV to JSON converter handles quoted fields and commas inside values.

Updated
Runs in your browser. Your data is not uploaded.

Convert types turns plain numbers, true, and false into JSON values and empty cells into null. Values like 00123 or 1e5 stay text, so ZIP codes and IDs keep every digit.

Converts as you type for inputs up to 200 KB.

How to use the CSV to JSON Converter

  1. Paste CSV into the input box, or upload or drag in a .csv or .tsv file up to 5 MB.
  2. Leave Delimiter on auto-detect or pick one, and set First row is the header, Convert types, the output shape, and the indent.
  3. Press Convert. The JSON appears with a row and column count. Press Copy or Download .json.

How it works

  • Parsing follows RFC 4180: fields can be wrapped in double quotes, quoted fields may contain the delimiter and line breaks, and "" inside quotes stands for one double quote.
  • A UTF-8 byte order mark at the start is removed, and blank lines are skipped.
  • Keys come from the header row. Without one, keys are column1, column2, and so on.
  • Convert types, when on: whole numbers and decimals without leading zeros become numbers, true and false become booleans, and an empty cell becomes null. Everything else stays a string, including 00123, 1e5, and phone numbers.

Examples

Input:

name,age,city
"Doe, Jane",34,Paris

Output:

[{"name":"Doe, Jane","age":34,"city":"Paris"}]

A column zip with the value 02134 gives [{"zip":"02134"}]. The leading zero is kept, so the value stays a string.

When to convert CSV to JSON

Spreadsheets are easy to edit, but code and APIs work with JSON. Converting CSV to JSON is the quickest way to load a sheet of products, users, or settings into an app, send it to an API, or use it as test data.

Keeping leading zeros

ZIP codes, phone numbers, product codes, and IDs often start with 0. Turning them into numbers would drop those zeros for good, so values with leading zeros always stay strings. If a column should never be converted, turn off "Convert types" and every value stays text.

Limitations

  • Input is limited to 5 MB.
  • A row with more or fewer cells than the header gives a warning with its row number. Missing cells become null, and extra cells go under _extra.
  • Duplicate header names get a suffix, such as name and name_2.
  • An unclosed quote gives an error with the line number.

Frequently asked questions

Does the first row become the JSON keys?

Yes, by default. Turn off "First row is the header" and keys become column1, column2, and so on.

Are numbers converted automatically?

Yes, when "Convert types" is on. Values with leading zeros, like ZIP codes, stay as text so no digits are lost.

Can values contain commas?

Yes, as long as the value is wrapped in double quotes, which is standard CSV.

Is my file uploaded?

No. Parsing happens entirely in your browser.

Often used together with the CSV to JSON.

  • JSON to CSV

    Turns an array of JSON objects into a CSV table.

  • convert XML to JSONDeveloper Tools

    Converts XML into readable JSON, with attributes and repeated elements handled.