THE FILE FIELD GUIDE
.jsonl

JSON Lines Data

Data & Science

JSONL stores one JSON value per UTF-8 line, often for logs, exchange or training data. It differs from one top-level JSON array; validate individual lines separately from the receiving schema.

Main use
Store an independent JSON value on each line
Data type
Text data
All sections, questions and sources

Content reviewed: · Editor:Kai

Opening steps

Choose your environment or purpose to see its steps.

Text editor / JSON Lines-capable tools

Preserve the original and inspect a working copy in a compatible application.

  1. Open a copy in a UTF-8 editor and inspect initial lines.
  2. Validate individual lines using a suitable JSON parser/tool.
  3. Check required fields and record count before downstream processing.
Inspect the received file and its requirements

Establish dependencies and settings before proceeding.

  1. Inspect UTF-8 encoding, BOM and blank lines.
  2. Distinguish record delimiters from escaped newlines in strings.
  3. Agree on key names, types and required fields.

Menu labels and support vary by app, OS and version. Preserve the original before making changes.

Troubleshooting by symptom

  • Extra-data error: check whether the reader expects a single JSON value.
  • One line fails: inspect quotes, backslashes and blank lines.
  • Fields rejected: valid JSONL can still violate the recipient’s schema.
  • Too large to open: inspect incrementally instead of loading everything into a spreadsheet.

JSONL → JSON array / CSV etc.

  1. Parse lines into an array or select fields for tabular export.
  2. Check record count, syntax, required keys, encoding and personal data.

CSV does not preserve nested structures, arrays, nulls and types equivalently.

Valid JSONL versus valid application data

A line can syntactically hold values other than objects, while a consumer may require objects/specific keys. Format validation alone does not establish application validity.

Source for these steps:JSON Lines project · JSON Lines / IETF · RFC 8259: JSON

Worked example: checks before handoff

Example: for a consumer requiring messages, check one value per line and then validate that field’s type, required members and record content.

Source for these steps:JSON Lines project · JSON Lines / IETF · RFC 8259: JSON

Related-format differences

Related-format differences
Format / methodPurpose and preserved information
.jsonlStore an independent JSON value on each line
JSON / CSVJSON stores a whole structure and CSV a table; inspect nested/type preservation.
JSONL → JSON array / CSV etc.CSV does not preserve nested structures, arrays, nulls and types equivalently.

Handling and security

Logs/training data may contain personal information, API keys and internal URLs; inspect before sharing.

Questions and answers

How does it differ from JSON?

JSONL adds a line-delimited storage convention for JSON values.

Can a string contain a newline?

Escape string newlines appropriately rather than spreading one record across physical lines.

Is a blank line a valid record?

A blank line has no JSON value and is not a JSON Lines record; inspect consumer requirements too.

Format facts: name, steward and MIME type
Formal name
JSON Lines Data
Steward / specification
JSON Lines project
MIME type
Consult the producer or delivery system. The extension alone does not establish a MIME type.

Primary and official sources

  • Project documentationJSON Lines

    UTF-8, one JSON value per line and line termination.

    JSON Lines project · Link checked:
  • StandardRFC 8259: JSON

    JSON syntax and string/number rules.

    IETF · Link checked: