---
title: JSON Lines (JSONL) Viewer and Editor | Prettify Docs
description: Prettify detects JSON Lines (NDJSON), shows it as JSON, and writes
  it back line by line. See how views, bad lines, and conversion work.
url: https://prettify.tools/docs/jsonl
---

[Docs](https://prettify.tools/docs) / Formats

# JSONL and NDJSON

Last updated: October 16, 2026

JSON Lines (JSONL, also called NDJSON) stores one JSON value per line. Log files, data exports, and streaming APIs use it. Prettify detects JSONL, shows it as JSON, and writes it back line by line. This page explains that behavior and its limits.

Open the editor at [/app/editor](https://prettify.tools/app/editor).

## How Prettify detects JSONL

Prettify checks for JSONL after it rules out a single JSON document. The text must have two or more non-blank lines, and the first lines must each parse as JSON on their own. A pretty-printed object that spans several lines is one document, so it stays JSON.

A `.jsonl` or `.ndjson` file also opens as JSONL. JSONL is detected automatically. It is not offered in the format pickers; Prettify presents it as JSON with a JSON Lines badge.

```jsonl
{"id": 1, "event": "login"}
{"id": 2, "event": "logout"}
{"id": 3, "event": "login"}
```

## Views

JSONL parses into an array of the line values, so the structured views work. Tree, Raw, and Table are free. Diagram (Pro) draws the data as a node graph.

Table view is the common choice, because each line becomes one row. See [Views](https://prettify.tools/docs/views) and [Table view](https://prettify.tools/docs/views).

## How it round-trips

Prettify writes JSONL back as one compact JSON value per line, not as a JSON array. The numbers stay exact, the same way they do for [JSON](https://prettify.tools/docs/json): bigints and Snowflake IDs survive parse, view, and serialize byte for byte.

A blank line and a trailing newline are skipped.

## Bad lines do not fail the document

One bad line does not stop the rest. Each good line still parses. Each bad line is kept in place as raw text and reported as a problem in the Problems panel.

This matters for a round trip. An edit, sort, copy, or download re-emits a bad line exactly as it was, so Prettify never drops your data. The document is invalid only when every non-blank line fails to parse.

## Convert and query

Convert turns JSONL into JSON, YAML, CSV, or XML; the lines behave like a JSON array. Converting JSON to JSONL writes each array element on its own line. A non-array document becomes a single-element array when it reloads as JSONL, and Prettify warns you. See [Conversion](https://prettify.tools/docs/conversion).

When you convert JSONL that still holds a bad line, the bad line is written as raw text, and every target except JSONL gets a warning.

jq (Pro) filters JSONL as it does JSON. See [jq queries](https://prettify.tools/docs/jq). Diff / Compare (Pro) is at [Diff](https://prettify.tools/docs/diff).

## Related pages

- [JSON](https://prettify.tools/docs/json) for the full number, comment, and repair behavior.
- [Conversion](https://prettify.tools/docs/conversion) for turning JSONL into other formats.
- [Privacy](https://prettify.tools/docs/privacy) for what stays on your device.

## Try it online

Tool pages for this topic. Each one runs in your browser.

- [JSONL Viewer](https://prettify.tools/jsonl-viewer)
- [JSON Viewer](https://prettify.tools/json-viewer)

* [PreviousJSON](https://prettify.tools/docs/json)
* [Next YAML](https://prettify.tools/docs/yaml)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Prettify",
  "url": "https://prettify.tools",
  "description": "Multi-format data viewer, editor, and query engine for JSON, YAML, CSV, XML, Mermaid, Markdown, MDX, HTML, and SVG",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web, macOS, Windows, Linux",
  "offers": [
    {
      "@type": "Offer",
      "price": "0",
      "priceCurrency": "USD",
      "description": "Free tier with core features"
    },
    {
      "@type": "Offer",
      "price": "19.99",
      "priceCurrency": "USD",
      "description": "Pro: lifetime access to all features"
    }
  ],
  "publisher": {
    "@id": "https://prettify.tools/#organization"
  }
}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://prettify.tools/#organization",
  "name": "Prettify",
  "legalName": "Off Leash Labs",
  "url": "https://prettify.tools/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://prettify.tools/icon-512.png",
    "width": 512,
    "height": 512
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "offleashlabs@gmail.com",
    "availableLanguage": "English"
  }
}
```
