Skip to content

JSON Lines to JSON converter

JSONL to JSON wraps line-delimited records into one pretty JSON array after flattening each record through the tabular model.

  • Converted with Table engine · nothing stored
  • Free: 5 conversions a day · 5 MB each
  • Higher limits →

From real runs

What you get — and what changes

  • Line records Kept

    Each non-empty JSONL line became one object in the output array, preserving source order.

  • Output container Changed

    The result is one bracketed JSON array rather than independent newline-delimited JSON objects.

  • Nested objects Changed

    Nested customer and extra fields flattened to dotted object keys in the final JSON.

  • Arrays Changed

    tags became a string containing JSON array text, so consumers must parse that field again if they need an array.

  • Missing fields Changed

    extra.gift was added to the first output object with a null value because the second line introduced that key.

  • Unicode and string IDs Kept

    The pretty JSON output retained 001, 02134, München, Zoë, and 東京 exactly as decoded values.

Sample conversions

Two-line event file

Input
JSONL line 1 was {"id":"001","customer":{"name":"Ada","city":"München"},"tags":["priority","quoted, comma"]}.
Output
JSON array object 1 had "customer.name": "Ada", "tags": "[\"priority\",\"quoted, comma\"]", and "extra.gift": null.

Late key from second line

Input
JSONL line 2 added {"extra":{"gift":true}}.
Output
The second JSON array object ended with "extra.gift": true while the first object received null for the same key.

A real JSON Lines → JSON run

We converted our JSON Lines sample (411 B) with Table engine on 2026-09-11. It took 1 ms and produced a 558 B JSON file, 1.4× larger than the input. The engine raised no warnings.

Input · sample.jsonl · 411 B

4 JSON objects, one per line; keys: company, stage, arr, owner, close_date

Records
4
Keys
company, stage, arr, owner, close_date

Output · sample.json · 558 B

Array of 4 objects; keys: company, stage, arr, owner, close_date

Records
4
Keys
company, stage, arr, owner, close_date

First lines of the output

json
[
  {
    "company": "Northwind Traders",
    "stage": "Proposal",
    "arr": 48000,
    "owner": "R. Ayers",
    "close_date": "2026-10-14"
  },
  {
    "company": "Contoso Ltd",
    "stage": "Negotiation",
    "arr": 120000,
    "owner": "P. Ng",
    "close_date": "2026-09-30"
  },
  {
    "company": "Fabrikam",
    "stage": "Qualified",
…

Options and when to change them

flattenSeparator
Change it if dotted keys are awkward for the consumer of the combined JSON array.
arrayMode
Use explode when arrays should be converted to indexed keys before the JSON array is produced.
encoding
Use latin1 only for legacy NDJSON files that are not UTF-8.

Do it yourself

Python json module

bash
python - <<'PY'
import json
with open("input.jsonl", encoding="utf-8") as f:
    rows = [json.loads(line) for line in f if line.strip()]
with open("output.json", "w", encoding="utf-8") as out:
    json.dump(rows, out, ensure_ascii=False, indent=2)
PY

This keeps nested JSON unchanged; tabular-ir flattens records before writing the array.

JSON Lines to JSON by API or MCP

The HTTP API and the MCP server run the exact engine this page uses (Table engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=jsonl&to=json.

curl
curl -X POST https://filetypeconverters.com/api/v1/convert \
  -H "Authorization: Bearer $FTC_API_KEY" \
  -F "file=@input.jsonl" -F "from=jsonl" -F "to=json" \
  -F 'options={"encoding":"utf-8"}' \
  --output output.json

Options this engine accepts for JSON Lines → JSON

KeyApplies toTypeDefault
encodingReading JSON Linesutf-8 · latin1utf-8
flattenSeparatorReading JSON Linesstring.
arrayModeReading JSON Linesjson · explodejson
delimiterWriting JSONstring,
newlineWriting JSON ·
sheetNameWriting JSONstring
dialectWriting JSONpostgres · mysql · sqlitepostgres
tableNameWriting JSONstringdata
createTableWriting JSONbooleantrue
API reference

When this is the wrong conversion

  • Do not convert huge JSONL streams to one JSON array if the next system processes events incrementally.
  • If malformed lines are common, validate or split the JSONL first so one bad line does not block the whole conversion.

JSON Lines to JSON questions

Does JSONL to JSON keep one object per line?

No. It creates one JSON array containing those objects. That makes the file easier for editors but less stream-friendly.

Are blank JSONL lines ignored?

Yes. The parser filters empty lines before parsing, so blank separators do not become null records.

Why did nested keys appear with dots in JSON output?

The conversion uses the tabular IR, which flattens nested objects into columns. JSON output then writes those columns as object keys.