Skip to main content

JSONL to JSON Converter — NDJSON and JSON Array Both Ways

Turn newline-delimited JSON into a JSON array and back, with bad-line numbers and pick-your-indent — browser only

  • Runs locally
  • Category Format Converter
  • Best for Turning pasted content or local files into a handoff-friendly format.
Direction
Output

What this tool does

A free two-way converter between JSONL/NDJSON and a JSON array, built for the moment you have one JSON object per line and need a real array, or the reverse. Going JSONL to JSON array, the tool parses every non-empty line, collects the values into a single array, and pretty-prints it at 2 spaces, 4 spaces, or compact. Blank lines are skipped, and if line 7 has a missing comma or a trailing brace it tells you exactly that: "line 7" plus the parser message, so you fix the source instead of hunting through a wall of text. Going the other way, paste a JSON array and it writes one compact object per line, which is the format log pipelines, BigQuery loads, and LLM fine-tuning sets expect. This is not a JSONL beautifier that keeps the line layout. It changes the shape between the two formats. Copy the result in one click or download it as .json or .jsonl. Everything runs in your browser tab, so no record, prompt, or dataset is ever uploaded.

Tool details

Input
Text + Numbers + Structured content
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy + Download
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 9 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Format Converter · Developer
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How JSONL to JSON Converter fits into your work

Use it when the main problem is getting content from one practical format into another.

Conversion jobs

  • Turning pasted content or local files into a handoff-friendly format.
  • Previewing a conversion before you use it in a larger workflow.
  • Cleaning small format mismatches without opening a full editor.

Conversion checks

  • Try a small sample first when the source format is messy.
  • Check character encoding, separators, and line endings after conversion.
  • Keep the source until the converted output has been reviewed.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 JSON Lines Formatter Validate JSONL line by line, pretty-print it, convert to a JSON array, or export a CSV-like table locally. Open
  2. 2 JSON Formatter & Validator Format, validate, and minify JSON instantly — right in your browser. Open
  3. 3 JSON to CSV Converter Turn a JSON array (or object) into clean CSV — flattens nested keys, escapes per RFC 4180, custom delimiter, UTF-8 BOM for Excel — browser-only Open

Real-world use cases

  • Load a streaming log dump into a tool that wants an array

    Your service writes one JSON event per line to a .jsonl file, and you want to drop the day's events into a notebook, a charting widget, or a quick JSON.parse in the console. Those expect a single array, not a stream. Paste the JSONL, convert to a JSON array, copy, and you have one parseable value with every event in order, ready for array.map and filter without a streaming reader in the loop.

  • Build an OpenAI-style fine-tuning file from an array of examples

    You collected training examples as a JSON array while prototyping, but the fine-tuning upload wants JSONL with one example object per line. Switch the direction to JSON array to JSONL, paste the array, and each example lands on its own compact line in the exact shape the trainer reads. Download the .jsonl and upload it without hand-editing brackets and commas out of a thousand-line file.

  • Find the one corrupt record in a 10,000-line export

    A BigQuery or Spark export of NDJSON fails to load and the loader only says "invalid JSON" with no location. Paste it here: the converter parses line by line and reports the first bad line by number with the parser message. You jump to that exact row, fix the stray comma or unescaped quote, and re-run the load instead of bisecting by hand.

  • Reshape an API response into a streamable feed

    An API hands you a big JSON array, but the downstream consumer, a Kafka producer or a tail-friendly log sink, wants newline-delimited records it can read one at a time. Convert the array to JSONL so each element becomes its own line, then pipe or append the result without re-serializing the whole payload as one giant object every time.

Common pitfalls

  • Expecting this to keep your line layout. A JSONL beautifier re-indents each line in place and keeps the file as JSONL. This converter changes the shape, so JSONL becomes one array and an array becomes one object per line. If you only want prettier JSONL, use the json-lines-formatter instead.

  • Pasting a JSON array while the direction is set to JSONL to JSON array. The array's outer brackets and inter-element commas are not valid on a single JSONL line, so the first line fails to parse. Flip the direction to JSON array to JSONL first, or strip the brackets if the data really is meant to be per-line.

  • Forgetting that JSONL has no commas between records. People hand-build JSONL by copying array elements and leave the trailing commas in. A line ending in a comma is invalid JSON on its own, so the parser flags it. Each line must stand alone as a complete value with nothing after it.

Privacy

Both directions, the line-by-line parse and the array reshape, are plain JavaScript that runs entirely in your browser tab. No JSONL, JSON array, log line, or training example is ever sent to a server, and nothing is logged. The one thing to watch: this tool deliberately does not write your input into the share URL, because logs and datasets are often large or sensitive. To share a result, use the copy or download button and send the file directly rather than passing a link.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-05-29