What is JSON Lines (JSONL)?
JSON Lines — also called JSONL or NDJSON (Newline-Delimited JSON) — is a text format where each line is a complete, independently-parseable JSON object. The newline \n acts as the record separator. Unlike a JSON array, JSONL enables true streaming: record one can be processed while record two is still loading from disk.
JSON Lines vs JSON: Key Parsing Differences
A standard JSON array must be fully buffered before the first record is returned. A 2 GB JSON file requires ~2 GB RAM just to begin iteration. JSONL eliminates this: each line is self-contained, so peak memory stays at the size of a single record regardless of file size. This is why Apache Spark, BigQuery, Elasticsearch, and most data-engineering tools prefer JSONL for large datasets.
- JSON array: one parse, full memory, not safely appendable.
- JSONL: O(1) memory streaming, trivially appendable, isolated error tolerance per line.
Formatting JSONL for OpenAI and LLM Fine-Tuning Datasets
The OpenAI fine-tuning API requires a .jsonl file where every line is a JSON object containing a messages array. Each message must carry a role ("system", "user", or "assistant") and a non-empty content string. This validator surfaces per-line structural errors before you submit to any fine-tuning endpoint.
Streaming Big Data via Newline-Delimited JSON
The file upload engine in this tool uses PHP's fgets() to read one line at a time, process each object, and write output incrementally. Peak RAM stays under 8 MB whether you upload a 10 KB test file or a 100 MB production export.
Converting CSV Rows to JSON Lines Objects
The CSV → JSONL converter reads your header row as property keys and emits one JSON object per data row. Empty cells become null; numeric strings and "true"/"false" are optionally auto-coerced to native JSON types. The parser is RFC 4180 compliant — handles quoted fields containing commas.
Converting JSONL Back to a JSON Array
The JSONL → JSON Array converter collects every JSONL line into a standard [{...},{...}] array. Useful when consuming APIs or tools that expect a single JSON body rather than a streaming NDJSON feed — Excel, Tableau, REST APIs, and more.
What file formats are accepted for upload?
.jsonl, .ndjson, .json, .csv, and .txt — up to 100 MB.
Is my data private?
Pastes under 2 MB are processed entirely in your browser — no data is transmitted. Uploaded files are processed in isolated server-side streams and deleted immediately after the response is sent. No data is stored or logged.