What Is the Difference Between JSON and JSONL?

JSON: one value (object or array) per file. JSONL (JSON Lines): one JSON object per line, no wrapping array. JSONL is better for streaming and large datasets. In JSON, you must parse the entire file to access any record. In JSONL, you can read and process one line at a time.

Side-by-Side Comparison

JSON (data.json)

[
  {"name": "Alice", "age": 30},
  {"name": "Bob", "age": 25},
  {"name": "Charlie", "age": 35}
]

JSONL (data.jsonl)

{"name": "Alice", "age": 30}
{"name": "Bob", "age": 25}
{"name": "Charlie", "age": 35}

Key Differences

FeatureJSONJSONL
StructureOne value per fileOne value per line
StreamingMust parse entire fileProcess line by line
AppendingMust rewrite fileAppend a new line
MemoryLoad entire fileOne line at a time
Use caseConfig, APIsLogs, datasets, ETL

Reading JSONL

Python

import json
with open('data.jsonl') as f:
    for line in f:
        record = json.loads(line)
        print(record['name'])

Bash

# Process each line with jq
cat data.jsonl | jq -r '.name'

Try It Yourself

Format your JSON with our JSON Formatter or validate it with our JSON Validator.

Built by Michael Lip. 100% client-side — no data leaves your browser.