LazyTools

🔒 Every tool runs in your browser, the files and values you enter are never uploaded to any server. How it works

📃 JSON to JSONL Converter

Turn a JSON array into JSONL: each element becomes one line of compact JSON, the format streaming tools and ML pipelines expect.

3 items → JSONL (one per line)

Rate this tool:
Anonymous, no account, no identifier

How the json to jsonl converter works

The converter parses your input as JSON, checks that the top level is an array, and writes each element as its own line of compact (single-line) JSON separated by newlines, the JSONL / NDJSON format. It is the exact inverse of the JSONL-to-JSON tool: an array of N objects becomes N lines. If the input isn't a JSON array (for example a single object), it tells you, because JSONL is a list of records by definition. Each element is serialised with no internal line breaks, so however an object was indented in the source array, it collapses to a single physical line in the output. Element 0 becomes line 1, order is preserved, and the outer [ ], commas and indentation of the array are dropped.

JSONL is what many systems want for bulk work: OpenAI and other LLM fine-tuning endpoints take JSONL training files, and data-warehouse loaders and log shippers stream it line by line. Producing it from a normal JSON array is a frequent last step before uploading a dataset. Because everything runs in your browser, training data and exports never leave your device.

Frequently asked questions

How do I convert a JSON array to JSONL?

Paste or load a JSON array and the tool writes each element on its own line as compact JSON, that newline-delimited output is JSONL (NDJSON). Copy or download the result.

Why does it require an array?

JSONL is a sequence of records, so the converter needs a top-level array to know where each record begins and ends. A single object isn't a list, so it reports that instead of guessing.

What is JSONL used for?

Streaming and bulk data: LLM fine-tuning files (OpenAI and others), BigQuery and warehouse loads, and log pipelines all use one-record-per-line JSON so records can be appended and processed independently.

Is the output minified?

Each line is compact single-line JSON (that's the JSONL convention), while the lines themselves are separated by newlines so each record stays on its own row.

Why does an object with a newline in a string still stay on one line?

A newline inside a string value is stored as the escape sequence \n, which is not a real line break, so the record remains a single physical line. JSONL only forbids literal line breaks between tokens, escaped ones inside strings are perfectly valid.

How do I turn my array into a fine-tuning file?

Shape each element as one training record (for example {"messages":[…]}), paste the array, convert, and download the .jsonl. The tool writes exactly one record per line, which is the layout LLM fine-tuning and bulk-load endpoints expect.

Is anything uploaded?

No, the conversion runs locally in your browser and works offline, so datasets stay private.

Related file converters