Converting CSV to JSON looks like a one-liner. Then a quoted comma shows up. These are the traps worth knowing.

1. Splitting on commas

line.split(",") breaks on "Smith, John",42. Use a real parser that handles quoted fields and escaped quotes ("").

2. Newlines inside quoted fields

A single record can span several lines. Reading the file line by line will cut those records in half.

3. Everything becomes a string

CSV has no types. "007" must stay a string, but "42" is probably a number. Decide per column instead of auto-converting everything, or you will lose leading zeros in IDs and zip codes.

4. Byte order mark in the header

Excel exports often start with a BOM (\uFEFF), so your first key becomes "\uFEFFid" and row.id is undefined. Strip it before parsing.

5. Different delimiters

Many European locales use ; instead of , because the comma is the decimal separator. Detect or configure the delimiter.

6. Empty values

Decide whether an empty cell means "", null or a missing key, and be consistent so downstream code does not break.

Try it: CSV to JSON runs in your browser, so your data is never uploaded. Also see JSON to CSV and CSV Viewer. All 590+ tools at webdevtoolbox.com run client-side.