Data Format Converter

CSV to JSON Converter

Paste CSV or open a file to get a JSON array with one object per row. The conversion runs entirely in your browser, so your data is never uploaded.

Swap to JSON to CSV

Paste text, or drop a file here

JSON

    Example

    CSV input

    id,name,zip,active,price
    1,Ada Lovelace,02134,true,19.50
    2,"Hopper, Grace",94103,false,7

    JSON

    [
      {
        "id": 1,
        "name": "Ada Lovelace",
        "zip": "02134",
        "active": true,
        "price": 19.5
      },
      {
        "id": 2,
        "name": "Hopper, Grace",
        "zip": 94103,
        "active": false,
        "price": 7
      }
    ]

    How it handles tricky cases

    Leading zeros

    Values like the ZIP code 02134 stay text, because turning them into numbers would drop the zero. The same goes for numbers too long to hold exactly.

    Delimiters

    Commas, semicolons, tabs and pipes are detected automatically. Choose one by hand if a file is detected wrongly.

    Quoted fields

    Fields in double quotes can contain delimiters and line breaks, and a doubled quote stands for a literal quote, as in RFC 4180.

    Repeated or blank headers

    JSON keys must be unique, so a repeated column a becomes a and a_2, and a blank header becomes column_3 or similar. A note appears when this happens.

    Uneven rows

    Missing cells at the end of a row become null. Extra cells get column_N keys so nothing is dropped.

    Do it from code

    Python standard library:

    import csv, json
    
    with open("in.csv", newline="", encoding="utf-8") as f:
        rows = list(csv.DictReader(f))
    with open("out.json", "w", encoding="utf-8") as f:
        json.dump(rows, f, indent=2, ensure_ascii=False)

    Questions

    Can I keep every value as text?

    Yes. Turn off number and boolean detection and every value stays a string.

    Can columns become nested objects?

    Yes. With nesting on, the columns address.city and address.zip become an address object.

    Is my CSV uploaded?

    No. The file is read and converted on your device.

    Related tools