What Is JSONL?
JSONL, also called JSON Lines or NDJSON, is a text format where every line is one complete JSON value. Most often each line is an object. There is no outer array and no comma between lines, so the file can be written and read one line at a time. A JSONL file usually ends in .jsonl or .ndjson.
{"id": 1, "name": "Ada Lovelace"}
{"id": 2, "name": "Grace Hopper"}The format is common for logs, exports from databases and search tools, and the datasets used to train and test machine learning models, where each line holds one example. This page is a general viewer. It does not check that the records follow any particular schema.
JSONL vs JSON: What Is the Difference?
A JSON file holds one value, usually a big array or object. A parser has to read the whole file before it can use any of it. A JSONL file holds many small values, one per line, so a program can stream it, append to it and split it by lines without parsing everything.
- JSON: one document, wrapped in [ ] or { }, commas between items, may span many lines.
- JSONL: one JSON value per line, no wrapper and no commas, each line stands alone.
- A JSONL file as a whole is not valid JSON. A JSON array is not valid JSONL, unless the whole array sits on one line.
Because a line break ends a record, a record cannot contain a raw line break. A line break inside a string is written as \n, which is what JSON requires anyway. If you need to escape or unescape text for a string, JSON Escape and JSON Unescape do that.
How to Open a JSONL File
A JSONL file is plain text, so any text editor opens it, but a large file is hard to read that way. With this viewer, press Open file and pick the file. It is read in your browser, and the records appear as a list, with line numbers, a key summary and a search box. Files up to 20 MB are accepted. Pasted text is limited to 2,000,000 characters.
Each record row shows the line number and the start of the line. Open it to see the record formatted with indentation. The formatting keeps the original numbers and key order exactly as written, so a long ID such as 12345678901234567890 is not rounded.
Records are shown 25 per page, which keeps the page quick even with hundreds of thousands of lines. Search looks through the text of every record and is not case sensitive.
Find Invalid Lines in a JSONL File
One broken line is enough to make a program that reads the file fail. The viewer checks every line on its own and lists the ones that are not valid JSON. For the Example, line 3 is missing its closing brace:
Line 3
Expected ',' or '}' after property value in JSON at position 45 (column 46)
{"id": 3, "name": "Linus", "role": "engineer"The wording of the reason comes from your browser, so it can differ a little between browsers. The column number counts from the start of that line. The usual causes are a missing bracket, a trailing comma, single quotes instead of double quotes, a line break in the middle of a record, or two records on one line.
Blank lines are skipped and counted. Lines that hold a plain value such as a number, a string, null or an array are valid JSON and are kept as records.
Convert JSONL to a JSON Array
Press Convert to JSON to turn the lines into a single JSON array. With Pretty print on, the array is indented with two spaces. With it off, you get one compact line. For the Example with the broken line skipped, the compact result starts like this:
[{"id":1,"name":"Ada Lovelace","role":"mathematician","tags":["math","analysis"]},{"id":2,"name":"Grace Hopper","role":"admiral","tags":["compilers"]},{"id":4,...}]Skip invalid lines is on by default, so bad lines are left out and the rest is converted. Turn it off to stop at the first bad line and see its number. The tool reports how many records went into the array, so you can compare it with the number of lines in your file.
If you want a spreadsheet instead, convert to a JSON array first and then use JSON to Excel. To read a spreadsheet as JSON, use Excel to JSON.
Convert JSON to JSONL
Open the JSON to JSONL tab, paste a JSON array and the tool writes one compact line per item. Items can be objects, arrays or plain values. The Example array of three objects gives three lines, and converting those lines again gives back the same three records.
{"id":1,"name":"Ada Lovelace"}
{"id":2,"name":"Grace Hopper"}The input must be one JSON array. If you paste a single object, wrap it in square brackets. If you paste text that is already JSONL, the tool reports that it is not valid JSON, so use the first tab for that.
Limits and Privacy
The viewer does not edit records in place, validate against a schema or convert to CSV. Very deep nesting, more than 100 levels, is shown in compact form instead of indented. A file over 20 MB is refused, so split it first with a tool such as split on the command line.
Everything runs in your browser. The file and the pasted text are not sent to a server and are not stored. See the Privacy Policy for details.