Cadmeo

CSV to JSON Converter

Quoted fields containing the delimiter are handled correctly.

JSON: 2 objects
[
  {
    "name": "Amara",
    "role": "Engineer",
    "joined": 2021
  },
  {
    "name": "Caleb",
    "role": "Designer, Senior",
    "joined": 2023
  }
]

The CSV to JSON converter turns delimited rows into an array of objects, using a parser written to RFC 4180 rather than splitting on commas. That distinction matters: any CSV containing a quoted field with a comma inside it (an address, a job title, a description) breaks a naive split immediately.

How it works

The parser walks the input character by character, tracking whether it is inside a quoted field. Inside quotes, delimiters and newlines are ordinary characters; a doubled quote is an escaped quote.

  1. Read characters, toggling quote state on an unescaped double quote.
  2. A delimiter outside quotes ends the current field; inside quotes it is literal text.
  3. A newline outside quotes ends the row; inside quotes the field continues across lines.
  4. Two consecutive quotes inside a quoted field produce one literal quote character.

Type detection is deliberately conservative. A value becomes a number only if converting it and back produces the identical string, which keeps leading zeros, long IDs and phone numbers as strings rather than silently corrupting them.

Examples

A quoted field containing a comma

CSV

name,role,joined
Amara,Engineer,2021
Caleb,"Designer, Senior",2023

Result

[
  { "name": "Amara", "role": "Engineer", "joined": 2021 },
  { "name": "Caleb", "role": "Designer, Senior", "joined": 2023 }
]

The comma inside "Designer, Senior" stays part of the value. Splitting on commas would produce a four-field second row and shift every column after it.

Conservative type detection

CSV

id,code
1,007
2,42

Result

id becomes a number; code stays a string because "007" would lose its leading zeros

Number("007") is 7, and String(7) is not "007", so the round-trip test fails and the value stays a string. This is what stops product codes and postcodes being mangled.

Ragged rows

CSV

a,b,c
1,2
3,4,5,6

Result

Flagged: rows have different column counts (2, 3, 4)

Short rows are padded with empty values and extra fields are dropped, but the mismatch is reported rather than hidden. It usually means a delimiter appeared in an unquoted field.

Frequently asked questions

Does it handle commas inside quoted fields?

Yes, and that is the main reason to use it rather than a spreadsheet export or a one-line split. The parser tracks quote state, so a comma inside quotes stays part of the value and a newline inside quotes does not end the row.

Why did my product code lose its leading zeros?

It should not have. Type detection only converts a value to a number when converting back produces the identical string, so "007" stays a string. If you are seeing numeric conversion you do not want, switch the value types option to keep everything as strings.

How do I escape a quote inside a quoted field?

Double it, as RFC 4180 specifies: "she said ""hello""" produces she said "hello". Backslash escaping is not part of the CSV format and is not recognised.

Is my data uploaded anywhere?

No. The parser runs in your browser and the page makes no network requests, which matters because CSV exports frequently contain customer data.

Compared with