← Back to DevKit

JSON ⇄ JSONL Converter

JSON ⇄ JSONL · DATA & PROCESS

Convert between JSON arrays and NDJSON (one JSON per line) in both directions, validating line by line and flagging bad line numbers; handles large text with a 10MB batching hint.

Converted locally — nothing is uploaded.
Input
Output
Direction is auto-detected: starts with [ → JSON array to NDJSON; otherwise NDJSON to JSON. Bad lines are flagged by line number. Each line is parsed independently so one bad line does not spoil the rest.

>_ USAGE GUIDE

NDJSON (newline-delimited JSON) — one JSON object per line — is common in log pipelines and streaming APIs. This tool converts both ways and validates line by line.

Typical steps:

  1. Paste content: a JSON array or several NDJSON lines; direction defaults to "Auto"
  2. Choose direction: in Auto, a leading [ means array→NDJSON, otherwise NDJSON→array; you can also force a direction
  3. Pretty toggle: for NDJSON→JSON, tick "pretty output" to get an indented array, otherwise a single compact line
  4. View result: output shows the conversion; bad lines are flagged red with their line numbers, and one bad line never spoils the rest

>_ FAQ

Q1 · What is NDJSON?

NDJSON (Newline-Delimited JSON) puts one independent JSON object per line, separated by newlines — easy to stream and process line by line, common in logs and big-data pipelines.

Q2 · How are bad lines handled?

Each line is parsed independently. When a line is invalid JSON, its number is recorded and flagged red in the message area, while every other valid line still converts.

Q3 · What about very large text?

Conversion runs locally on strings only — zero upload. Above 10MB a "batching recommended" hint appears; true streaming is not implemented yet, so split huge files and convert in chunks.

Q4 · Can I override the auto direction?

Yes. Auto detects by default, but you can switch to "JSON → JSONL" or "JSONL → JSON" to force a direction before converting.

Q5 · Does conversion alter values?

No. Conversion only changes the "array wrapping / newlines" presentation; field names and values are preserved — cross-check against the output.

Embed code

Paste the code below into your page to embed this tool as an iframe (nav and footer auto-hidden).

Heightpx
This tool runs entirely in your browser — input never leaves your device. Press Ctrl K to switch tools anytime.