JSON Lines Converter
Convert JSON Lines (NDJSON) to a JSON array and back
JSON Lines Input
JSON Array Output
About
Convert between JSON Lines (NDJSON — one JSON value per line) and a JSON array in either direction. Common for log streams, LLM training data, and ndjson-based APIs. Per-line parsing errors are reported with the line number. Everything runs in your browser; nothing is uploaded.
Examples
Parse a JSONL log stream
{"event":"page_view","path":"/home","user":"u1"}
{"event":"click","element":"CTA","user":"u1"}
{"event":"page_view","path":"/pricing","user":"u2"}[
{"event": "page_view", "path": "/home", "user": "u1"},
{"event": "click", "element": "CTA", "user": "u1"},
{"event": "page_view", "path": "/pricing", "user": "u2"}
]Three newline-separated JSON values are collected into a single JSON array. Each line is parsed independently.
Spot a malformed line in JSONL
{"id":1,"name":"Alice"}
{"id":2,"name":"Bob"}
{"id":3,"name":Charlie}
{"id":4,"name":"Diana"}Line 3: Unexpected token 'C' — "Charlie" must be quoted
Line 3 JSON: <invalid>
Lines 1,2,4: parsed successfullyThe tool parses each line independently and reports the exact line number of the error without stopping at the first failure.
About this tool
JSON Lines (JSONL or NDJSON) is a format where each line is a complete, valid JSON value — ideal for log files, streaming data, and large datasets that need to be processed one record at a time without loading the entire file into memory. It is line-delimited rather than array-wrapped, which means tools can append to or read from a JSONL file without parsing the whole document.
This converter handles both directions. JSONL → JSON parses each line and returns a standard JSON array, with per-line error reporting showing the line number of any malformed entry. JSON → JSONL joins array items into one valid JSON value per line, suitable for streaming or log ingestion.
How to use
Choose a direction
Pick JSONL → JSON to flatten a newline-delimited stream into an array, or JSON → JSONL to split an array into one JSON value per line.
Paste your data
Drop the JSONL stream or the JSON array into the input panel.
Read the result
If converting from JSONL, a line-aware error report shows the exact line number of any malformed entries. Copy the result or download it as a file.
Use cases
Processing a JSONL log export
Convert a newline-delimited log file from a data platform or CLI tool into a standard JSON array for analysis in a JSON-aware tool.
Splitting a JSON array for streaming
Convert a large JSON array into one JSON value per line so tools like awk, jq, or a streaming pipeline can process it record by record.
Validating a JSONL data feed
Paste a JSONL file and catch any malformed lines with their exact line numbers before ingesting the data.
Common mistakes
Mistake:Expecting the converter to fix malformed JSON inside a line.
Fix:JSONL requires every line to be a standalone, valid JSON value. The converter parses each line independently — a trailing comma or missing quote is a syntax error on that line, not something it can auto-fix.
Mistake:Confusing JSONL with JSON arrays split across lines.
Fix:A JSON array like [1,\n2,\n3] is a single JSON value spanning multiple lines. JSONL is [1]\n[2]\n[3] — one complete JSON value per physical line.
Mistake:Appending to a JSON array instead of appending a line.
Fix:To append to a JSONL file, write a new complete JSON object followed by a newline. Do not write a partial array fragment — it would break the JSONL format.
Frequently asked questions
Related guides
References & standards
Related tools
TOML Validator
Validate TOML and re-emit it as clean, indented JSON
TOML to JSON Converter
Convert TOML to JSON and JSON to TOML in either direction
CSV to SQL Converter
Generate SQL INSERT statements from CSV data
JSON Schema Validator
Validate a JSON document against a JSON Schema
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV
Find and Replace Text
Find and replace text with optional regex, case, and multiline matching