HandyBench

CSV to JSON Converter

Turn CSV rows into clean JSON.

How to use the CSV to JSON Converter

  1. 1 Paste your CSV data into the box.
  2. 2 Choose the delimiter (or leave it on auto-detect) and whether the first row is a header.
  3. 3 Pick array-of-objects or array-of-arrays output, then copy or download the JSON.

What the parser does with your CSV

The converter first splits your text into lines and drops completely empty ones. It then decides on a delimiter. With auto-detect on, it counts commas, tabs, semicolons and pipes in the first line only and uses whichever occurs most. A tie goes to the earlier candidate in that order, and a one-column file with no delimiters defaults to comma. Each line is then read character by character, tracking whether it is inside double quotes. Inside quotes, a doubled "" becomes one literal quote, and delimiters are ignored.

Output shapes

  • Array of objects: the header row supplies the keys. If you untick "First row is a header", keys are generated as column_1, column_2 and so on.
  • Array of arrays: each row is a plain list. The header row is dropped when the box is ticked, otherwise it stays as a row.

Worked example

A semicolon file, as exported by Excel in locales that use a decimal comma:

name;city;age
Ada;"London, UK";36
Grace;NYC

Auto-detect counts two semicolons against none of the others, so it picks ;. Object output is:

[{"name":"Ada","city":"London, UK","age":"36"},{"name":"Grace","city":"NYC","age":""}]

The quoted comma survived, 36 is the string "36" because nothing is type-converted, and Grace's missing third cell became an empty string. In array-of-arrays mode the same data gives [["Ada","London, UK","36"],["Grace","NYC"]], and the short row stays short.

Edge cases worth knowing

  • Numbers stay strings. Convert them in your own code, or the receiving API may reject "36" where it expects 36.
  • Duplicate header names collapse. With two columns named a, the later one overwrites the earlier in object output.
  • Extra cells are dropped. A row longer than the header loses its overflow in object mode. Array mode keeps everything.
  • Quoted line breaks are not supported. The text is cut into lines before quotes are considered, so a multi-line cell will split into separate rows. Delimiters inside quotes also count toward auto-detection on the first line, so set the delimiter by hand if your header row contains quoted text.
  • Pretty-print indents with two spaces. Untick it for single-line output, which is smaller to paste into a request body.

To go the other way, use JSON to CSV. To pull out specific columns before converting, try the CSV column extractor, or turn the data into a document table with CSV to Markdown.

Examples

  • ▸ Converting a spreadsheet export into JSON for an API request.
  • ▸ Turning a semicolon-delimited European CSV into JSON with the delimiter override.

Frequently asked questions

How does delimiter auto-detection work?

The converter counts commas, tabs, semicolons and pipes in the first line and picks whichever appears most. Override it manually if your file uses an unusual delimiter.

What is the difference between array-of-objects and array-of-arrays output?

Array-of-objects uses your header row as keys, producing [{"name":"Ada"}, …] — ideal for APIs. Array-of-arrays keeps each row as a plain list of values, [["Ada"], …], useful when you do not need field names.

Does it handle quoted fields with commas or line breaks?

Quoted fields can contain delimiters and escaped quotes (""), following standard CSV (RFC 4180) rules. Line breaks inside a quoted field are not supported, because the text is split into rows before quotes are examined.

Why are my numbers wrapped in quotes in the JSON?

Every value is read as text, so 36 becomes "36". CSV has no data types, and the converter does not guess. Convert numbers and booleans in your own code after parsing.

What happens if a row has fewer or more cells than the header?

In object mode a short row gets empty strings for the missing keys, and extra cells beyond the header are dropped. Array-of-arrays mode keeps each row exactly as it was.

Is my data uploaded anywhere?

No. Parsing runs entirely in your browser, so the CSV data you paste never leaves your device.