Skip to main content

JSON to NDJSON Converter (and NDJSON to JSON)

JSON array to NDJSON and back, one compact JSON value per line, with bad-line numbers and pick-your-indent, all in your browser

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

What this tool does

A free two-way converter between a JSON array and NDJSON, the newline-delimited JSON format also written JSONL or JSON Lines. Going array to NDJSON, the tool parses your [{...},{...}] array and writes every element as one compact JSON value on its own line, which is the exact shape that streaming pipelines, append-only log files and bulk loaders expect. Going the other way, it reads one JSON value per line, collects them into a single array and pretty-prints it at compact, 2-space or 4-space indent. Blank lines can be skipped, and when a line will not parse the tool gives you its 1-based line number so you can jump straight to the broken row in a million-line file. It counts lines and objects, copies the result with one click, and keeps your input and direction in the URL so a share link reopens the same conversion. Everything runs locally in your browser tab. No upload, no server, no log of what you paste.

Tool details

Input
Files + Text + Structured content
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy
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 JSON to NDJSON 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 Formatter & Validator Format, validate, and minify JSON instantly — right in your browser. Open
  2. 2 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
  3. 3 JSON Minifier Minify JSON into a compact single line, optionally sort object keys, and keep everything local. Open

Real-world use cases

  • Prepare a BigQuery bulk load

    You exported a table as a JSON array but BigQuery's load job only accepts newline-delimited JSON. Paste the array, switch to array to NDJSON, and you get one object per line ready to drop into the load UI or pipe into bq load with --source_format=NEWLINE_DELIMITED_JSON. No script, no jq one-liner to remember.

  • Build an Elasticsearch _bulk payload base

    The _bulk API wants one JSON document per line. Convert your array of source documents to NDJSON here to get the row-per-line shape, then interleave the action lines your indexer needs. Starting from clean NDJSON beats hand-splitting an array and hoping every comma landed in the right place.

  • Inspect a streaming log dump as a real array

    A service handed you a .ndjson log file and you want to eyeball it as structured data. Paste the lines, convert NDJSON to a JSON array at 2-space indent, and now you can fold it, search it, or drop it into a JSON viewer. If a line is malformed, the tool points you straight at the line number instead of failing silently.

  • Fix the one broken row in a 100k-line export

    A nightly export of 100,000 NDJSON lines fails to import and you have no idea which row is bad. Paste it, convert to array, and the tool stops at the first unparseable line with its number, for example Line 83,402. You fix that single row and re-run the import instead of bisecting the file by hand.

Common pitfalls

  • Feeding a single JSON object instead of an array when going array to NDJSON. The mapping is one array element to one line, so the input must be wrapped in [ ]. A lone {"a":1} is rejected; write [{"a":1}] if you really have one record.

  • Leaving trailing commas on NDJSON lines after copying out of an array. Each line must be a standalone JSON value, so {"a":1}, with a comma fails to parse. Convert the whole array here instead of editing lines by hand.

  • Expecting the NDJSON output to be a single valid JSON document. It is not; it is a sequence of values with no outer brackets, so do not paste raw NDJSON into a tool that wants one JSON object. Convert back to an array first when you need a single document.

Privacy

Every step here, the array-to-NDJSON split and the NDJSON-to-array join, is plain JavaScript running in your browser tab. Nothing you paste is uploaded, and there is no log of your data anywhere. The one caveat: the shareable link encodes your input and direction in the URL, so a link pasted into chat records that data in the recipient server's access log. For confidential payloads, use the copy button and paste the text rather than sharing the URL.

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