Convert CSV to JSON

Turn a CSV file into JSON: one object per row with the header as keys, or arrays. Numbers and true/false can be typed, and zip codes and long IDs stay text.

Your files never leave your computer: they're opened and processed right here in your browser, and nothing is uploaded.

Or paste your data

How to convert CSV to JSON

  1. Choose a CSV or TSV file, or paste CSV text.
  2. Check the preview. Untick "First row is the header" if your file has none: you then get arrays, or objects with keys "Column 1", "Column 2".
  3. Pick the shape, value types and layout, then download or copy the JSON.

For a file with the header id,name,active, the default output is:

[
  { "id": 1, "name": "Ann", "active": true },
  { "id": 2, "name": "Bob", "active": false }
]

Other ways

In Python: csv.DictReader plus json.dump gives objects with every value a string. In JavaScript, Papa Parse with header: true does the same, and dynamicTyping: true converts numbers (dropping leading zeros). Excel and Google Sheets can't save JSON.

Questions

Are numbers written as numbers or strings?
With "Numbers, true/false and null typed" (the default), 42 and 3.50 become JSON numbers, true and false become booleans and empty cells become null. Values a number would change stay strings: 02134, +44 20 7946 0958, IDs longer than 15 digits (JavaScript can't hold them exactly). Choose "Everything as text" to get every value as a string, empty cells as "".
What if two columns have the same name?
JSON keys must be unique, so the second gets a suffix: name, name_2. Empty headers become "Column 3" and so on.
Can I get nested JSON?
Yes: tick "Nest dotted column names" and columns like address.city and address.zip become {"address": {"city": ..., "zip": ...}}; columns tags.0, tags.1 become an array.
What is JSON Lines?
One JSON object per line, without the surrounding array (also called NDJSON). Tools such as BigQuery, Elasticsearch and many log pipelines import it, and big files can be read line by line.
Is the CSV uploaded?
No. It is converted in your browser; you can also paste the CSV and copy the JSON.