CSV to JSON

Convert CSV rows into JSON objects or arrays.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

CSV to JSON Converter Online

The CSV to JSON converter turns comma-separated data into JSON that you can drop straight into an API request, a JavaScript app, a NoSQL database, or a config file. Paste CSV or open a .csv file and the JSON appears as you type, together with a sortable table preview of the parsed rows so you can see at a glance that every column landed where it should.

Four JSON shapes

  • Array of objects – the classic format: one object per row, keys taken from the header. Ideal for REST APIs, MongoDB imports, and front-end tables.
  • Array of arrays – the header row followed by value rows. Compact, and easy to feed into charting libraries.
  • Object of columns – {"name": [...], "city": [...]}. Handy for column-oriented analysis and plotting.
  • Keyed by first column – each row is stored under its ID, e.g. {"1": {...}, "2": {...}}, for quick lookups.

Smart parsing

The parser implements RFC 4180, so quoted fields containing commas, quotes, and even line breaks are read correctly. Duplicate or empty header names are made unique (name, name_2, column3), short rows are padded with empty values, and a UTF-8 byte-order mark at the start of the file is ignored. When your data has no header row, switch the option off and the columns are named column1, column2, and so on.

Types and nesting

Spreadsheets store everything as text, but JSON has real numbers and booleans. Type detection converts 42 and true while keeping values like 007 as strings. Dotted headers such as user.name can be expanded into nested objects, which is the reverse of the flattening done by JSON to CSV.

Private by design

The conversion runs entirely in your browser — the data is never uploaded, so it is safe to use with customer lists and internal exports.

Need a different target? Try CSV to XML, CSV to SQL, or CSV to HTML. To just look at a file, open it in the CSV Viewer.

Frequently Asked Questions

Leave the delimiter on Auto-detect: the converter looks at the first lines and picks the comma, semicolon, tab, or pipe that splits every line into the same number of fields. Files exported from Excel in European locales often use semicolons, which auto-detection handles.

With “Detect numbers & booleans” on, cells like 42, -3.5, true, and false become JSON numbers and booleans. Values with leading zeros such as ZIP codes (00501) or phone numbers stay strings so nothing is lost. Turn the option off to keep every value as a string.

Yes. Name columns with dots, for example address.city and address.zip, and switch on “Dot keys → nested objects”. Those columns are combined into an address object in every record.

Yes. The parser follows RFC 4180: a field wrapped in double quotes may contain the delimiter, line breaks, and doubled quotes ("" for a literal quote). An unclosed quote is reported with the line where the field starts.