JSON Lines Converter
Convert JSON Lines (NDJSON) to a JSON array and back
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 this tool
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
What happens when a line in the JSONL is malformed?
The tool reports the exact line number of the malformed entry and continues parsing the remaining lines. Every other valid line is included in the output.
Can I convert a JSON array with 10,000 items to JSONL?
Yes. Each array item becomes one line in the JSONL output. For very large arrays, the conversion is fast since it is a simple text transform.
Does the converter preserve trailing newlines?
No. The last line of a JSONL stream does not require a trailing newline. The tool normalises the output so each line contains exactly one JSON value.
Is my data uploaded anywhere?
No. All parsing and conversion run in your browser; the input is never transmitted or stored.
Related guides
References & standards
Related tools
Base64 Toolbox
Professional Base64 workspace for text, files and images with Base64URL, MIME, Data URI, strict validation, image preview and ready-to-use snippets.
C# to VB.NET Converter
Convert a subset of C# — classes, methods, variables, loops — into VB.NET
CSV Data Viewer
Paste CSV and browse rows in a sortable table with delimiter detection
CSV to Chart
Paste or upload CSV data and generate bar, line, pie, or doughnut charts. Export as PNG.
CSV to JSON Converter
Paste CSV data and convert it to pretty-printed JSON instantly — supports custom delimiters, header row toggling, and value trimming.
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV