Data formats
What is JSONL? JSON Lines explained
Quick answer
JSONL, short for JSON Lines, is a text format where every line is one complete JSON value — usually an object describing one record. Because each line stands alone, files can be written, read and checked one record at a time, which is why logs and AI training datasets often use it.
By SourceX Editorial · Updated
What a JSONL file looks like#
Each line is a separate JSON object, and lines are separated by a newline. There are no commas between records and no surrounding square brackets.
- {"id": 1, "question": "Where is my order?", "answer": "It ships today."}
- {"id": 2, "question": "Can I change my plan?", "answer": "Yes, from Settings."}
Why AI datasets use JSONL#
- Streaming: a program can process record 1 before reading record 2 million.
- Appending: adding data means adding lines, not rewriting a whole file.
- Fault isolation: one broken line does not make the rest unreadable.
- Splitting: a file can be cut into shards on any line boundary.
File extensions and names#
You will see .jsonl, and sometimes .ndjson (newline-delimited JSON). The two are effectively the same idea; the files should be UTF-8 text.
How to open a JSONL file#
Any text editor can open a small one. For browsing, searching and spotting broken lines, a viewer is easier: paste or upload the file into the JSONL viewer below and it stays in your browser.
Try it in your browser
Free tools. Your file is processed in this browser and not uploaded.
Frequently asked questions
Is JSONL the same as JSON?
Every line in a JSONL file is valid JSON, but the file as a whole is not a single JSON document. See JSONL vs JSON for the differences.
Can a JSONL record span multiple lines?
No. Pretty-printed objects that span several lines break the format. Each record must sit on one line; newlines inside strings are written as \n.
Is a blank line allowed?
The JSON Lines description does not allow empty lines, though many tools skip them. The JSONL validator lets you choose to skip or report them.
Sources
Related
Tell us what your models need
Share scope, volume, language, format, timing and licensing requirements.