JSONL / NDJSON Viewer Online

JSONL Viewer
Validate JSON Lines Instantly

Paste JSONL or NDJSON content to validate each line individually, view records as collapsible trees, and convert between JSONL and JSON arrays. Works with OpenAI fine-tuning files, Elasticsearch bulk data, log files, and LLM training datasets.

Open JSONL Viewer

Per-Line Validation

Each line is validated independently. Errors report the exact line number and position, making it easy to find and fix bad records in large files.

🌲

Tree View Per Record

Every valid record is displayed as a collapsible tree with syntax highlighting — the same view used for regular JSON formatting.

🔄

Convert JSONL ↔ JSON

Convert JSONL to a JSON array and back in one click. Useful for ingesting JSONL into tools that expect a standard JSON array.

Everything you need for JSON Lines

Per-Line Validation Validates each line as an independent JSON value with precise error locations.
Line Numbers Each record is labeled with its line number so you can quickly locate issues in large files.
Collapsible Tree View Expand and inspect each record as a formatted, syntax-highlighted tree.
JSONL → JSON Array Wrap all records in a JSON array with one click.
JSON Array → JSONL Split a JSON array of objects into JSONL format (one record per line).
Summary Statistics See total line count, valid count, and error count at a glance.
Works Offline Cached by a service worker. Process sensitive log files without an internet connection.
LLM / AI Ready The standard format for OpenAI fine-tuning files ({"messages":[…]} per line), Hugging Face datasets, and most AI training pipelines.

Your data stays in your browser

100% client-side processing

JSONL processing runs entirely in your browser. Log files and training data containing sensitive information are never uploaded or transmitted.

Related JSON tools

JSON Formatter Format and beautify regular JSON with syntax highlighting.
JSON Validator Validate JSON against RFC 8259 with precise error reporting.
JSON Repair Fix broken JSON: trailing commas, unquoted keys, single quotes.
JSON Schema Validator Validate JSON data against a JSON Schema definition.

Common questions answered

What is JSONL?

JSONL (JSON Lines) is a format where each line is a valid JSON value, typically an object. It is also called NDJSON (Newline Delimited JSON). It is widely used for log files, LLM training data, OpenAI fine-tuning datasets, Elasticsearch bulk imports, and data pipelines.

What is the difference between JSONL and JSON?

Regular JSON has one root value (an object or array). JSONL has one JSON value per line, making it easy to append records and stream data without loading the entire file. It is the standard format for OpenAI fine-tuning files and most AI training datasets.

Is this JSONL viewer free?

Yes, completely free with no account required.

Does the JSONL viewer send my data to a server?

No. All processing is 100% client-side in your browser — your data never leaves your device.

Can I convert a JSONL file to a regular JSON array?

Yes. jsonfmt.dev can convert JSONL to a JSON array (wrapping all records in []) and convert a JSON array back to JSONL (one record per line).

What is JSONL (JSON Lines)?

JSONL (JSON Lines), also called newline-delimited JSON (NDJSON), is a format where each line contains a separate valid JSON document. Unlike a single JSON array, JSONL allows line-by-line processing — ideal for log files, streaming data, database exports, and large datasets that will not fit in memory as a single document.

This viewer parses JSONL by splitting on newlines and parsing each line independently. It displays records in table, tree, or code view with navigation between lines. For large files, line-by-line parsing means the viewer shows results before the entire file is parsed — unlike tools requiring the complete dataset to be loaded first.

View JSONL log entries
Input
{"ts":"2024-01-15T10:00:00Z","level":"info","msg":"Server started"}
{"ts":"2024-01-15T10:00:05Z","level":"error","msg":"DB timeout"}
{"ts":"2024-01-15T10:00:06Z","level":"info","msg":"Reconnected"}
Output
┌─────────────────────┬───────┬────────────────┐
│ ts                  │ level │ msg            │
├─────────────────────┼───────┼────────────────┤
│ 2024-01-15T10:00:00 │ info  │ Server started │
│ 2024-01-15T10:00:05 │ error │ DB timeout     │
│ 2024-01-15T10:00:06 │ info  │ Reconnected    │
└─────────────────────┴───────┴────────────────┘

Get the most out of this tool

Ready to inspect your JSONL file?

Free forever. No signup. Works offline.

Open JSONL Viewer

Understanding JSONL — the streaming JSON format

JSONL (JSON Lines) is a text format where each line is an independent, complete JSON value — typically a JSON object. Also called NDJSON (Newline-Delimited JSON), it was designed to solve the streaming and append challenges of standard JSON. A standard JSON array requires the entire document to be valid before parsing begins, making it unsuitable for streaming or incremental append. JSONL's one-record-per-line design eliminates this constraint.

The streaming advantage of JSONL is its most important property. A log aggregator can write millions of events to a JSONL file by simply appending new lines — no need to open the file, parse the existing array, add a new element, and re-serialize the whole document. A consumer can begin reading and processing records from line one without waiting for the file to complete. This makes JSONL the format of choice for log files, event streams, and data pipelines.

JSONL files are trivially parallelizable for processing. Because each line is independent, a multi-threaded processor can split the file at line boundaries and process chunks in parallel without coordination. Standard tools like cat, head, tail, wc -l, grep, and sort all work correctly on JSONL files — the newline delimiter makes JSONL files behave like any text file for line-oriented Unix tools.

The jq command-line tool has native JSONL support. Running jq '.field' data.jsonl processes each line independently, applying the filter to each JSON object and outputting one result per line. This enables powerful one-liner data transformations on large JSONL datasets without loading the entire file into memory. The --slurp flag collects all lines into a JSON array for cross-record operations like aggregation.

Machine learning and AI datasets are frequently distributed as JSONL files. OpenAI's fine-tuning API accepts training data as JSONL where each line contains a messages array representing one conversation. Hugging Face datasets for NLP tasks use JSONL for train, validation, and test splits. The format's simplicity — any text editor can open and inspect a JSONL file — makes it accessible for dataset inspection and quality control.

Database export tools commonly produce JSONL output. MongoDB's mongoexport and the Google BigQuery export all produce JSONL by default. This format choice reflects the document-per-line pattern mapping naturally to database records, and the streaming design enabling efficient import with mongoimport without loading the entire dataset into memory first.

Error handling in JSONL streams is per-line. If one line contains malformed JSON, a robust JSONL processor can skip that line, log the error, and continue processing subsequent lines — unlike a standard JSON array where a single malformed element invalidates the entire document. This resilience to partial corruption makes JSONL suitable for long-running log streams where occasional write failures might truncate a line.

Real-world uses for JSONL format

Application log storage and analysis Modern applications emit structured logs as JSON objects — one log entry per line. Log aggregation systems like Loki, Elasticsearch, and AWS CloudWatch ingest JSONL natively. Storing logs as JSONL enables querying with JSONPath, filtering with grep, and streaming analysis with jq.
Machine learning training datasets LLM fine-tuning datasets, NLP corpora, and computer vision annotation files are commonly distributed as JSONL. Each line contains one training example — a labeled sentence, a conversation pair, or an annotated image metadata record. JSONL enables streaming loading during training without loading the full dataset into memory.
Database export and import MongoDB's mongoexport, BigQuery table exports, and Elasticsearch bulk API all use JSONL format. The one-document-per-line format maps directly to database records, and streaming import tools can process millions of records without memory pressure by reading and inserting line by line.
Event streaming pipelines Message queue consumers that write events to files use JSONL because appending a new line is an atomic operation on most filesystems. Kafka consumers, webhook receivers, and CDC (change data capture) pipelines all use JSONL as an intermediate format for event storage before batch processing.

JSONL pitfalls to avoid

Additional frequently asked questions

What is the difference between JSONL and NDJSON?

JSONL (JSON Lines) and NDJSON (Newline-Delimited JSON) are the same format with different names. Both require each line to be a complete, valid JSON value separated by newline characters. The JSONL name is more commonly used in the data engineering community; NDJSON is used in the streaming API community. The formats are fully interchangeable.

Can a JSONL file contain values other than objects?

Yes — technically any valid JSON value can appear on each line of a JSONL file, including arrays, strings, numbers, and booleans. However, the most common and useful case is one JSON object per line, where the object represents one record. Lines containing arrays or primitive values are less common but valid JSONL.

How do I convert a JSONL file to a JSON array?

Using jq: run jq --slurp '.' file.jsonl to collect all lines into a JSON array. Using Python: read all lines, parse each with json.loads(), collect in a list, and serialize with json.dumps(). This tool's JSONL tab can display and convert JSONL files directly in the browser.

Is there a file size limit for the JSONL viewer?

This viewer processes JSONL entirely in the browser with no file size limits imposed by a server. Large files (over 100KB) are processed in a Web Worker to keep the UI responsive. For very large JSONL files with millions of lines, the viewer shows paginated results to avoid DOM performance issues from rendering all records simultaneously.