JSONL Input
JSON Array Output
Converted output will appear here.

JSONL to JSON Converter Online

Convert a JSONL file: one JSON object per line: into a standard, formatted JSON array. Works with BigQuery table exports, Elasticsearch scroll outputs, OpenAI fine-tuning files, Hugging Face datasets, and structured log samples. No upload, no server.

When you need to convert JSONL to a JSON array

JSONL is the preferred format for data pipelines and ML systems because of its streaming properties. But once a pipeline run is complete and you want to inspect the data, run it through a JSON formatter, load it in a web app, import it into Postman, or feed it to a tool that expects a JSON array: JSONL becomes inconvenient. Every standard JSON tool, every language's built-in JSON.parse, and every API that accepts a body of type application/json expects a single JSON document, not newline-delimited records.

Converting is simple: each line becomes one element in the output [ ] array. The result is formatted with 2-space indentation for readability.

Concrete example

JSONL input: one record per line

{"id":1,"event":"signup","user":"alice@example.com"}
{"id":2,"event":"login","user":"bob@example.com"}
{"id":3,"event":"upgrade","user":"alice@example.com","plan":"pro"}

JSON array output: formatted, inspectable

[
  {
    "id": 1,
    "event": "signup",
    "user": "alice@example.com"
  },
  {
    "id": 2,
    "event": "login",
    "user": "bob@example.com"
  },
  {
    "id": 3,
    "event": "upgrade",
    "user": "alice@example.com",
    "plan": "pro"
  }
]

How to use

  1. Paste your JSONL content: one JSON object per line. Or click Sample for an example.
  2. Click Convert → to parse each line and wrap results into a JSON array.
  3. If any line fails parsing, you see the line number and specific error. Fix it or use the JSONL Viewer to identify all issues first.
  4. Copy the formatted JSON array or download it as a file.

Where these JSONL files come from

BigQuery exports
BigQuery's bq extract --destination_format NEWLINE_DELIMITED_JSON produces JSONL. Convert before loading into a JSON editor or API.
Elasticsearch scroll API
elasticdump and similar export tools output newline-delimited JSON. Convert for inspection or re-import into other tools.
ML dataset files
Hugging Face datasets, OpenAI fine-tuning files, and most LLM training data are distributed as JSONL. Convert samples for inspection in a JSON formatter or diff tool.
Structured log exports
Log aggregation platforms (Datadog, Loki, CloudWatch Insights) can export structured logs as JSONL. Convert to array for analysis or debugging.

What happens to invalid and blank lines

Blank lines: completely skipped. No empty elements appear in the output array. This matches the JSONL specification, which treats blank lines as separators.

Invalid lines: conversion stops at the first invalid line and reports the line number and parse error. Use the JSONL Viewer to find all invalid lines first: it shows every broken line with its error, so you can fix the file systematically before converting.

Privacy

Conversion runs entirely in your browser using native JSON.parse and JSON.stringify. JSONL files from data pipelines often contain user records, model training data, or internal event logs. Nothing you paste here is transmitted to any server.

Frequently asked questions

Why would I need to convert JSONL to a JSON array?

Most JSON tools, editors, and APIs expect a single JSON array, not newline-delimited records. If you have a BigQuery export or ML dataset in JSONL but need to inspect it in a formatter, pass it to an API, or import it into a tool that expects standard JSON, you need this conversion.

What happens if a JSONL line is invalid?

Conversion stops at the first invalid line and shows the line number and parse error. Use the JSONL Viewer to see all invalid lines with their errors before converting: it is easier to fix the source file than to debug a partially converted array.

Are blank lines included as null elements in the output?

No. Blank lines are skipped entirely and produce no elements. Only non-empty lines are parsed and added to the array.

My BigQuery JSONL export has records with different fields on each line. Will this work?

Yes. JSONL allows heterogeneous records. Each line is an independent JSON object with whatever fields it has. The output array will contain objects with different schemas: which is valid JSON.

Does the conversion preserve the original field order?

Yes. Modern JavaScript engines maintain insertion order for object keys. Fields in the output will appear in the same order they appear in each JSONL line.

The output JSON array is very large: how do I handle it?

For large outputs, use the Download button to save as a file rather than copy-pasting. For files with millions of records, command-line tools are more practical: jq -s '.' data.jsonl > data.json (requires jq) or python3 -c "import json, sys; print(json.dumps([json.loads(l) for l in sys.stdin if l.strip()]))" < data.jsonl

How do I convert back from a JSON array to JSONL?

Use the JSON to JSONL converter (/json-to-jsonl). It takes a JSON array and outputs one compact JSON value per line.

Related tools