What is JSONL

What is JSONL? JSON Lines and NDJSON explained

JSONL (JSON Lines) is a UTF-8 text format with 1 JSON value per line, so 1,000 records take 1,000 lines with no outer brackets or commas between them. You can open, query and convert JSONL files up to 1.5 GB in your browser with rows.page, free with no signup.

.jsonl.json
Drop a file here
Stays in your browserUp to 1.5 GB

No file handy? Open GSM8K math eval, test split (1,319 rows, 750 KB).

What is a JSONL file?

A JSONL file puts one complete JSON record on each line instead of wrapping all records in one array with commas between them. Each line parses as JSON on its own, but the file as a whole is not one JSON document. Here is a three-line file:

json
{"id": 1, "user": {"name": "Ada", "city": "London"}, "tags": ["admin", "staff"]}
{"id": 2, "user": {"name": "Linus", "city": "Helsinki"}, "tags": ["dev"]}
{"id": 3, "user": {"name": "Grace", "city": "New York"}, "tags": []}

What are the JSON Lines format rules?

The specification at jsonlines.org sets three requirements plus a few conventions:

  • The encoding is UTF-8, without a byte order mark.
  • Each line is a valid JSON value. Objects and arrays are the most common, but null or a number is allowed too; a blank line is not.
  • Lines end with \n. \r\n works as well, because whitespace around a value is ignored, and a newline after the last value is recommended but not required.
  • The suggested extension is .jsonl, and compressed files become .jsonl.gz or .jsonl.bz2.

NDJSON (newline-delimited JSON) is the same idea under another name, with the .ndjson extension and the media type application/x-ndjson. jsonlines.org suggests application/jsonl, which is not standardized yet. rows.page reads .jsonl, .ndjson and .ldjson the same way.

JSON Lines at a glance
PropertyValue
Extension.jsonl (NDJSON: .ndjson)
EncodingUTF-8, no byte order mark
Separator\n (\r\n also works)
What each line holdsOne valid JSON value
Media type for NDJSONapplication/x-ndjson
How to appendWrite the new value and a \n at the end of the file

Where are JSONL files used?

JSONL shows up wherever software writes or moves records one at a time:

  • Application and server logs, one event per line as it happens.
  • Machine learning datasets, such as files hosted on Hugging Face.
  • OpenAI's Batch API and fine-tuning, which both take JSONL files as input.
  • BigQuery, which exports and loads JSON as newline-delimited JSON.

Why use JSONL instead of a JSON array?

To add a record to a JSON array on disk, you have to remove the closing ], write a comma and the new object, and close the array again. With JSONL you append one line. A reader can also parse one line at a time and let it go, instead of tracking brackets across the whole file.

Valid JSON escapes every newline inside a string as \n, so a raw newline only ever separates records. That makes line-based shell tools safe: count records, take the first 100, or split a big file into chunks of 100,000 lines.

bash
wc -l data.jsonl
head -n 100 data.jsonl > sample.jsonl
split -l 100000 data.jsonl part_

wc -l counts newline characters, so it comes up one short when the last record has no trailing newline.

Why won't my JSONL file parse?

  • Pretty-printed records: an object spread over several indented lines breaks the one-value-per-line rule. Write each record compactly, for example with jq -c.
  • Trailing commas: deleting the outer [ and ] from a JSON array leaves lines like {"id": 1},, which are not valid JSON.
  • Blank lines: an empty line is not a JSON value, so strict parsers stop there. A single newline after the last record is fine.
  • Wrong encoding: the spec requires UTF-8 without a byte order mark. A file saved as UTF-16 or Windows-1252 can fail to parse, so re-save it as UTF-8.

How do you open and query a JSONL file?

Drop a .jsonl, .ndjson or .ldjson file on rows.page, or click Paste data and paste the lines. DuckDB-WASM reads it in your browser without uploading it, up to 1.5 GB per tab; a bigger file loads its first rows with the note "Loaded the first N rows: the file is X, more than the browser can hold." Rows load in pages of 100 as you scroll, and any row opens in a side drawer with a JSON/Fields toggle.

Nested objects become dot-path columns such as user.city, up to 8 levels deep and 200 child fields per object, and arrays stay list columns. Filter with country:NL or price:>20, or type SQL against the table data, with double quotes around column names that contain dots:

sql
SELECT "user.city", count(*) AS users
FROM data
WHERE "user.name" IS NOT NULL
GROUP BY "user.city"
ORDER BY users DESC

Export saves the current view as CSV, Parquet (zstd), a JSON array, JSONL or a Markdown table of the first 1,000 rows. rows.page has no whole-file tree view and can't edit cells, so fix broken lines in a text editor or with jq first.

rows.page limits and prices

WhatLimit or price
Open a file in your browserFiles up to 1.5 GB, $0, no account, nothing uploaded
Share a link without an account$0, files up to 100 MB, link deleted 7 days after creation
Free account$0, 10 datasets kept, last 3 versions
Pro$12/month, 100 datasets, files up to 500 MB, private links
Max$39/month, 1,000 datasets, files up to 2 GB, private links

Questions

What is the difference between JSON and JSONL?

A .json file is one JSON value, usually an array of objects, that a parser reads as a whole. A .jsonl file holds one JSON value per line with no outer brackets and no commas between lines, so you can append to it and stream it line by line.

Is NDJSON the same as JSONL?

In practice, yes: both put one JSON value on each line. JSON Lines suggests the .jsonl extension, NDJSON uses .ndjson and the media type application/x-ndjson, and rows.page opens .jsonl, .ndjson and .ldjson alike.

How do I convert JSONL to CSV or Parquet?

Open the file in rows.page and pick CSV or Parquet in the Export menu; CSV is comma-delimited UTF-8 without a BOM and Parquet uses zstd. Filtered views export every matching row, while SQL results stop at 1,000,000 rows.

How do I open a JSONL file in Excel?

rows.page doesn't write Excel files, but it exports CSV, which Excel opens. Drop the .jsonl file on rows.page, let nested objects flatten into dot-path columns, and export CSV; cells that start with =, +, - or @ get a leading apostrophe so Excel doesn't run them as formulas.

Can I share a JSONL file from the command line?

Run curl -T data.jsonl https://rows.page to upload it and get a link. Without an account you can push 100 MB per request, 50 pushes and 1 GB per IP address per UTC day, and links expire after 7 days; signed in, Free keeps 10 datasets, Pro ($12 per month) 100 and Max ($39 per month) 1,000.