CSV ↔ NDJSON
Two-way conversion between CSV and NDJSON (Newline Delimited JSON), preserving numeric types when detected.
Saída:
—
CSV to NDJSON, one object per line
NDJSON, or JSON Lines, is the format with one JSON object per line. It became the standard input for stream processing tools, for bulk loading into document databases and for training sets, because it lets you read record by record without holding the whole file in memory. Spreadsheets and system exports, on the other hand, almost always come out as CSV.
The conversion runs both ways: pick the direction and paste. From CSV to NDJSON, each record becomes a JSON line with the header row naming the fields; on the way back, the keys of all objects form the header, in the order they first appeared. The CSV reader is complete enough where it counts: a quoted field containing a comma, doubled quotes representing a literal quote, and a line break inside a quoted field are all handled correctly — which is precisely where improvised converters fall over.
A note on types: values come out as text. A CSV carries no types at all — the number 007 might be a code that must keep its leading zeros, and converting it to a number would destroy it. If the destination needs real numbers or booleans, that type conversion is the consumer's decision, made with knowledge of what each column means.
Frequently asked questions
Why one line per object rather than an array?
What if the CSV has repeated column names?
Can the file be large?
Related Tools
JSON Lines → CSV
Convert JSONL (NDJSON) file to CSV, deriving headers from the union of all observed object keys.
CSV → JSON Lines
Convert CSV to JSONL (one JSON object per line). Common format in logs, ML pipelines and document databases.
CSV ↔ vCard (.vcf) Batch Converter
Converts a CSV contact list into a multi-contact vCard (.vcf) file and back to CSV, with column mapping and vCard 3.0/4.0 output.
CSV ↔ PSV Converter
Convert CSV (comma-separated) files to PSV (pipe-separated |) and vice versa, with quote and newline handling.
CSV to JSON
Convert CSV to JSON. The first row becomes object keys, the rest become array items. Supports separators , ; and \t. Auto-detects numbers and booleans. Everything in your browser.
Fixed-Width ↔ CSV/JSON Converter
Converts fixed-width text files to CSV, TSV or JSON and back, with automatic column detection, a position map and per-line warnings.