CSV to JSON
csv_to_jsonConverts CSV/TSV data from text or a file into pretty-printed JSON objects or arrays while detecting delimiters, reading headers, and typing numbers, booleans, and nulls.
Instructions
Convert CSV/TSV to JSON with an RFC 4180 parser (quoted fields, "" escapes, line breaks inside quotes, CR/LF/CRLF, BOM). Detects the delimiter (comma, semicolon, tab, pipe), uses the first row as headers (blank → column_N, duplicates → name_2), and can type values (numbers, true/false, null; long digit strings like IDs stay strings). Output: array of objects or array of arrays, pretty-printed. Give "text" or a file "path". Web version: https://s3eidat.github.io/csv-json/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Or: a path to a CSV/TSV file (UTF-8; use this for big inputs). | |
| text | No | The CSV as inline text. | |
| shape | No | "objects" (one object per row) or "arrays" (rows as arrays). | objects |
| types | No | Turn numbers, true/false and empty/null into JSON types (default true). | |
| header | No | First row is a header (default true). | |
| output | No | Optional: also write the result to this file path (or folder ending in "/"). The result text is then left out of the reply. Results over 1,000,000 characters are always written to a file. | |
| delimiter | No | Delimiter: "auto" (detect), ",", ";", "tab" or "|". | auto |