CSV to JSON Converter

Convert CSV to JSON in the shape your code expects, with the delimiter detected automatically and numbers typed correctly.

CSV
JSON
Runs locally in your browser

About the CSV to JSON Converter

CSV is deceptively simple: quoted fields can contain commas and line breaks, delimiters vary by locale, and Excel exports may start with a byte-order mark. This converter uses a full RFC 4180 parser that handles all of that and auto-detects comma, semicolon, tab or pipe. The first row becomes the keys unless you untick the header option, in which case columns are named column1, column2 and so on.

Three output shapes cover most needs: an array of objects for APIs and most code, an array of arrays when position matters or the data is large, and an object of column arrays for charting libraries. Numbers, booleans and null are typed by default; turn that off for identifiers with leading zeros such as postcodes. Headers that contain dots, like address.city, can be expanded into nested objects.

A quoting error, such as a field that opens a quote and never closes it, is reported with the line number. The reverse converter flattens JSON back to a sheet, and CSV Viewer shows the parsed table so you can check the columns before converting.

How to use

  1. Paste CSV or upload a .csv file exported from Excel or Sheets.
  2. Check the delimiter was detected correctly, choose the output shape and whether to type values.
  3. Copy the JSON or download it. Swap sends it to JSON to CSV.

Common questions

My numbers have leading zeros that got removed. Why?
Type conversion turns 00123 into 123. Untick "Convert numbers and booleans" to keep every value as a string.
How do I handle a semicolon-separated file?
Auto-detect usually picks it up. If the whole row lands in one key, set the delimiter to semicolon explicitly.
Can it read a file with line breaks inside quoted cells?
Yes. The parser follows RFC 4180, so quoted multi-line cells are read as one value.
What is the maximum file size?
Files of tens of megabytes parse in a second or two. The output pane may become slow above that; use Download instead of scrolling.