CSV · TSV · PIPE · SEMICOLON  →  JSON

CSV to JSON: one paste.

Paste a spreadsheet export, an API mock, or a test fixture and Rowson hands back clean JSON in four shapes, including JSONL for LLM pipelines. Delimiters are detected for you, and every byte is converted right here in your browser.

Start converting
Format
Delimiter
Input · CSV
Output · JSON
Output will appear here
Paste or drop CSV to begin Processed locally, data never leaves the browser

Reference

CSV dialect and JSON output reference

“CSV” is not one format but a cluster of incompatible dialects, and the quiet failure point is escape rules: a field holding a literal quote survives the parser that wrote it, then breaks under another dialect’s parser. This reference lays out which dialects exist, their quoting conventions, what each of the four JSON output shapes is good for, and which libraries implement which behavior.

CSV dialects, separators, and quoting

DialectField separatorQuote charEscape ruleDefined by
RFC 4180,"double the quote: ""IETF RFC 4180 (2005)
Excel CSV, (locale-dependent)"double the quotede facto, Microsoft Office
TSV (IANA)\toptional "backslash or doubled quoteIANA text/tab-separated-values
TSV (Unix)\tnonetabs and newlines forbidden in fieldsde facto, Unix tools
MySQL OUTFILE,"backslash: \"MySQL SELECT INTO OUTFILE
PostgreSQL COPY,"double the quotePostgreSQL COPY ... CSV
European semicolon;"double the quoteExcel, decimal-comma locales
Pipe-delimited|usually noneoften forbid pipes in fieldsde facto, mainframe and ETL

The most common silent failure sits at the boundary between RFC 4180 (quote-doubled) and MySQL (backslash-escaped): a field holding a literal " reads fine in the dialect that wrote it and corrupts in the other.

SeparatorHexDecimalUsed byDetected by Rowson
Comma0x2C44RFC 4180, Excel (en-US), MySQL, PostgreSQLyes (priority 1)
Tab0x099IANA TSV, Unix TSVyes (priority 2)
Semicolon0x3B59Excel (European locales)yes (priority 3)
Pipe0x7C124mainframe, ETL, Apache Hiveyes (priority 4)

Rowson detects the top four. Anything else, such as the ASCII unit separator (0x1F), a caret, or a colon, needs a pre-processing step that swaps the separator for a tab or comma before paste.

For quoting, RFC 4180, Excel, and PostgreSQL COPY all quote a field when it contains a delimiter, a quote, or a CR/LF, and write a literal quote as two adjacent quotes:

id,name,note
1,"Smith, John","She said ""hello""."

MySQL OUTFILE instead backslash-escapes (\"), which is not RFC 4180. Round-tripping through it and back into a default parser mis-reads any field with a literal backslash. IANA TSV backslash-escapes tab and newline inside fields; the looser Unix convention forbids them entirely and uses no quoting, which is what awk -F'\t', cut, and sort assume.

JSON output formats and where each is used

FormatSpecificationMIME typeExtensionTypical consumer
Array of objectsRFC 8259 / ECMA-404application/json.jsonJS apps, REST request bodies
JSONLjsonlines.orgapplication/x-ndjson.jsonl, .ndjsonBigQuery bq load, DuckDB, OpenAI fine-tuning
Array of arraysRFC 8259application/json.jsonChart libraries (Plotly, Highcharts)
Keyed objectRFC 8259application/json.jsonLookup tables, ID-indexed cache loads

Each format trades a property the others keep.

PropertyArray of objectsJSONLArray of arraysKeyed object
Preserves all rows when keys collideyesyesyesno
Preserves header namesyesyesfirst row onlyyes
Parseable line by linenoyesnono
Parseable as a single JSON valueyesnoyesyes
Round-trips back to CSV cleanlyyesyesyesno (lossy)
Supports streaming insertnoyesnono

JSONL is the only line-orientable format; the other three require the consumer to buffer the whole document before parsing. For a multi-hundred-megabyte file destined for a data warehouse, JSONL is the only viable choice.

Encoding, headers, and parser libraries

EncodingBOM bytesWhat modern parsers do
UTF-8 (no BOM)noneparse as-is
UTF-8 with BOM0xEF 0xBB 0xBFPapaParse 5.4.1+, Python csv 3.9+, Go 1.20+ strip it
UTF-16 LE/BE0xFF 0xFE / 0xFE 0xFFmost parsers fail; pre-decode to UTF-8
Windows-1252nonedecoded as Latin-1 unless the reader sniffs

When an Excel-saved CSV reads back as mojibake, the cause is almost always Windows-1252 vs UTF-8; save as “CSV UTF-8 (Comma delimited)” instead.

Header conventionFirst row containsCommon in
Headers presentcolumn namesExcel exports, web downloads, API fixtures
No headersdata from row 1sensor logs, older database exports
Commented headers#-prefixed rows above dataUnix tools, R read.csv(comment.char="#")

Rowson assumes headers present. For headerless input, prepend a synthetic header row or pick array-of-arrays and let the consumer assign keys.

LanguageCSV libraryJSON output
JavaScript / TSPapaParse (Rowson uses this)array of objects; auto-delimiter via delimiter: ""
Pythonpandas.read_csvto_json(orient="records"); add lines=True for JSONL
Goencoding/csv (stdlib)manual; pair with encoding/json
JavaOpenCSV, Apache Commons CSVmanual; pair with Jackson
Shellcsvkit (csvjson)AoO, plus --stream for JSONL

Common conversion failures

SymptomCauseFix
Numeric columns become quoted stringsCSV has no numeric typeCast after parsing: Number(row.amount)
Leading zeros stripped on IDsExcel coerces 00123 to 123 on editImport the column as text in Excel
Output has fewer rows than the CSVKeyed-object mode collapsed duplicate keysSwitch to array of objects or JSONL
null values come out as "null"CSV has no null literalNormalize empty, "null", "\N" (MySQL) to JSON null
Characters render as é instead of éUTF-8 file decoded as Latin-1Re-save source as UTF-8 with BOM
First field name appears as idUTF-8 BOM not strippedinput.replace(/^/, "") in preprocessing
JSONL rejected by BigQueryTrailing blank line or non-UTF-8 byteStrip trailing newline; verify with iconv

Related concepts

  • RFC 4180: the closest thing to a CSV specification. Two pages. Describes the comma-quote-doubled-CRLF dialect most libraries default to; silent on encoding, headers, and escape variants.
  • JSON Lines (jsonlines.org): the informal spec for newline-delimited JSON. Predates RFC 7464 and is more widely used.
  • ND-JSON (application/x-ndjson): identical content to JSONL, different MIME type and trailing-newline rules. Often interchangeable.
  • text/csv MIME type: registered in RFC 7111, defines optional charset and header=present|absent parameters almost no producer sets.
  • CSVW: a W3C effort to add schema and semantics to CSV via a sidecar JSON manifest. Seen in government open-data publishing; rare elsewhere.