JSONL to JSON

Parse a JSON Lines (NDJSON) file — where each line is an independent JSON object — into a single standard JSON array, ready for APIs, databases, or further processing. Toggle pretty-print to get an indented, human-readable result or keep output compact for minimal file size. Paste text directly or upload a .jsonl file, and the conversion completes instantly in your browser with no data sent to any server.

Input

JSONL

Output

3 lines
Output

JSON

What is JSONL to JSON Converter?

The tools that produce JSONL and the tools that consume JSON arrays are often different. BigQuery exports JSONL. pandas' to_json(orient="records", lines=True) writes JSONL. But the JSON viewer in your IDE, the REST API client you are testing with, and the schema validation tool you are using all expect a standard JSON array. This converter collects every line from a JSONL file and assembles them into a single JSON array, with configurable indentation for readable output. Lines that fail to parse are either skipped (permissive mode, with a count of failed lines in the summary) or halt the conversion with an error report (strict mode). The total line count, parse success rate, and any skipped lines are reported alongside the output. Compatible with both .jsonl and .ndjson file extensions and handles trailing newlines and blank lines automatically.

How to Use

  1. 1

    Paste Your JSONL Content

    Paste newline-delimited JSON (one JSON object per line) into the input panel, or upload a .jsonl or .ndjson file. Blank lines and lines with leading/trailing whitespace are handled automatically.

  2. 2

    Set Parsing Options

    Choose whether to skip lines that fail to parse (permissive mode) or halt on the first error (strict mode). Set the output indentation level for the resulting JSON array.

  3. 3

    Convert to JSON Array

    Click "Convert to JSON". Each valid JSONL line is parsed and collected into a single JSON array. The total line count, successfully parsed count, and any skipped lines are reported.

  4. 4

    Copy or Download the JSON Array

    Copy the JSON array for use in a REST API, data analysis tool, or code editor — or download it as a .json file for import into tools that require a standard JSON array.

Common Use Cases

Log File Aggregation

Collect JSONL-formatted application logs into a single JSON array for batch processing, analysis, or import into log management tools that work with JSON arrays rather than line-delimited streams.

LLM Output Processing

Language model inference pipelines often output results as JSONL. Convert the output to a JSON array to process, filter, and aggregate results using standard JSON tools and libraries.

BigQuery Export Processing

BigQuery data exports are delivered in JSONL format. Convert them to JSON arrays for processing with JavaScript, Python, or feeding into tools that expect standard JSON array input.

Batch API Response Assembly

Streaming or batch API calls that return one JSONL line per result can be assembled into a single JSON array for bulk processing, storage, or passing to downstream services.

Conversion Examples

JSONL Lines → JSON Array

Each line is parsed and collected into a single JSON array.

Input JSON

{"id":1,"event":"login","user":"alice"}
{"id":2,"event":"purchase","user":"bob"}
{"id":3,"event":"logout","user":"alice"}

Output CSV

[
  {"id": 1, "event": "login",    "user": "alice"},
  {"id": 2, "event": "purchase", "user": "bob"},
  {"id": 3, "event": "logout",   "user": "alice"}
]

LLM Output JSONL → Aggregated Results

Model inference results streamed as JSONL are assembled into a reviewable array.

Input JSON

{"index":0,"text":"Paris","score":0.97}
{"index":1,"text":"London","score":0.91}
{"index":2,"text":"Berlin","score":0.88}

Output CSV

[
  {"index": 0, "text": "Paris",  "score": 0.97},
  {"index": 1, "text": "London", "score": 0.91},
  {"index": 2, "text": "Berlin", "score": 0.88}
]

Frequently Asked Questions