Skip to content

JSON to JSON Lines converter

JSON to JSONL emits one compact object per line, but our table engine flattens nested JSON before writing the newline-delimited records.

  • 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

  • Top-level array Changed

    The surrounding JSON array brackets were removed and each record was written on its own line.

  • Record count Kept

    Two input JSON objects produced exactly two JSONL lines in the downloaded file.

  • Nested objects Changed

    customer.name, customer.city, and extra.gift became flat keys in each line object.

  • Arrays Changed

    The tags arrays became JSON-encoded strings inside each line object rather than native arrays.

  • Null padding Changed

    The first line received extra.gift:null because another record introduced that column.

  • String and Unicode values Kept

    String IDs with leading zeros and non-ASCII city names were preserved in the JSONL output.

Sample conversions

Compact event lines

Input
JSON array with id "001", customer city München, tags ["priority","quoted, comma"], and zip "02134".
Output
First JSONL line: {"id":"001","customer.name":"Ada","customer.city":"München","tags":"[\"priority\",\"quoted, comma\"]","zip":"02134","active":true,"total":1234.5,"due":"2026-09-10","empty":null,"extra.gift":null}.

Second line with late field

Input
Second JSON object had extra.gift true and tags [].
Output
Second JSONL line included "tags":"[]" and "extra.gift":true with no surrounding array comma.

A real JSON → JSON Lines run

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

Input · sample.json · 557 B

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

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

Output · 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

First lines of the output

jsonl
{"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","arr":22500,"owner":"R. Ayers","close_date":"2026-11-02"}
{"company":"Tailspin Toys","stage":"Won","arr":64000,"owner":"M. Okafor","close_date":"2026-09-03"}

Options and when to change them

flattenSeparator
Set this before conversion if dot keys conflict with the event consumer's field naming rules.
arrayMode
Choose explode for small fixed arrays that should become indexed line fields.
encoding
Use latin1 only for unusual JSON files that are not UTF-8 encoded.

Do it yourself

Python json module

bash
python - <<'PY'
import json
with open("input.json", encoding="utf-8") as f:
    rows = json.load(f)
with open("output.jsonl", "w", encoding="utf-8") as out:
    for row in rows:
        out.write(json.dumps(row, ensure_ascii=False, separators=(",", ":")) + "\n")
PY

This direct dumper keeps nested arrays and objects; tabular-ir flattens them first.

JSON to JSON Lines 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=json&to=jsonl.

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

Options this engine accepts for JSON → JSON Lines

KeyApplies toTypeDefault
encodingReading JSONutf-8 · latin1utf-8
flattenSeparatorReading JSONstring.
arrayModeReading JSONjson · explodejson
delimiterWriting JSON Linesstring,
newlineWriting JSON Lines ·
sheetNameWriting JSON Linesstring
dialectWriting JSON Linespostgres · mysql · sqlitepostgres
tableNameWriting JSON Linesstringdata
createTableWriting JSON Linesbooleantrue
API reference

When this is the wrong conversion

  • Do not convert JSON to JSONL if the target expects one valid JSON document with a single enclosing array.
  • If nested arrays must remain arrays in each event, use a direct JSONL writer rather than the tabular flattening route.

JSON to JSON Lines questions

Is JSON to JSONL the same as minifying JSON?

No. It changes the container from one array document into one JSON object per line. The output is meant for stream processors and log pipelines.

Does JSON to JSONL preserve nested arrays?

Not as arrays in this route. The default tabular conversion serializes arrays to strings before writing JSONL lines.

Can one JSON object be converted to JSONL?

Yes. The parser treats a top-level object as one record, so the output becomes one JSONL line after flattening.