Форматер и проверщик NDJSON

ДанныеРазработчикТекст
Реклама · УДАЛИТЬ?

Или

Параметры

Stats and per-line errors will appear here.
Реклама · УДАЛИТЬ?

Гид

NDJSON Formatter & Validator

Форматер и проверщик NDJSON

Paste a Newline-Delimited JSON (NDJSON / JSON Lines) document and check every record at once. Each line is parsed independently, so a single broken record does not hide the rest. The tool reports valid and invalid line counts, the most common top-level keys, and the exact parse error for any line that fails — perfect for log streams, BigQuery exports, and Elasticsearch bulk payloads.

Как использовать

  1. Paste your NDJSON content into the input box, or drop a .ndjson / .jsonl / .txt file using the uploader.
  2. Pick a format mode: Компактный keeps one record per line (true NDJSON), or Pretty rewrites each record with indentation and blank-line separators.
  3. Переключать Skip blank lines if your data has stray empty rows you want to drop, and Sort object keys for deterministic diffs.
  4. Read the stats panel for total / valid / invalid line counts and per-line error messages, then copy or download the formatted output.

Возможности

  • Per-line validation – every line is parsed independently with the exact JavaScript JSON.parse error message and the original line number.
  • Compact and pretty modes – switch between strict one-record-per-line NDJSON and human-readable multi-line formatting on demand.
  • Top-key distribution – see which top-level fields appear most often across valid records, useful for ad-hoc schema discovery.
  • Sort keys – alphabetise object keys deeply for reproducible diffs and stable hashes.
  • Blank-line handling – count and optionally strip empty lines that some tools insert into log streams.
  • File and clipboard friendly – upload large files, copy the cleaned output to clipboard, or download it as a ready-to-pipe NDJSON file.
  • Работает полностью в браузере – nothing is uploaded; the tool is safe for sensitive log data and exports.

When to Use NDJSON

NDJSON is the de-facto wire format for streaming JSON: Docker and Kubernetes container logs, Elasticsearch _bulk bodies, BigQuery exports, OpenAI batch jobs, and Loki ingestion all use one independent JSON object per line. A standard JSON formatter chokes the moment it hits the first newline, while this tool was built specifically for that shape.

Реклама · УДАЛИТЬ?

Часто задаваемые вопросы

  1. What is the difference between JSON and NDJSON?

    Standard JSON encodes a single value (object, array, number, string, boolean, or null) per document. NDJSON, also called JSON Lines or LDJSON, encodes one independent JSON value per line, separated by a newline character. NDJSON is streamable: a parser can process records as they arrive without loading the whole file into memory, which is why it dominates log pipelines and bulk APIs.

  2. Why are NDJSON records not allowed to contain unescaped newlines?

    The newline character is the record separator in NDJSON, so any unescaped newline inside a value would split one record into two. The format requires that the JSON encoder produce a compact representation per record, with embedded newlines written as the escape sequence backslash-n. Pretty-printed JSON, with indented multi-line objects, therefore is not valid NDJSON.

  3. Is NDJSON the same as JSON Lines and LDJSON?

    In practice, yes. NDJSON (newline-delimited JSON), JSON Lines (jsonlines.org), and LDJSON (line-delimited JSON) all describe the same convention: one JSON value per line, separated by U+000A newline. Minor specifications differ on whether trailing whitespace, the UTF-8 BOM, or carriage-return line endings are tolerated, but every parser worth using accepts plain LF-separated records.

  4. How does line-by-line validation differ from validating the whole document?

    With a normal JSON parser, the first syntax error aborts the entire parse and obscures any later problems. Line-by-line validation runs an independent parser per line, so each record either succeeds or surfaces its own error message and line number. This isolates broken records, lets you keep importing the valid ones, and makes diffing producer changes much easier.

  5. What MIME type and file extension should NDJSON use?

    The IANA-registered media type for NDJSON is application/x-ndjson, and application/jsonl is also widely accepted. The conventional file extensions are .ndjson and .jsonl. Using .json for a newline-delimited file is technically incorrect and breaks tools that auto-detect format from the extension.

Хотите убрать рекламу? Откажитесь от рекламы сегодня

Установите наши расширения

Добавьте инструменты ввода-вывода в свой любимый браузер для мгновенного доступа и более быстрого поиска

в Расширение Chrome в Расширение края в Расширение Firefox в Расширение Opera

Табло результатов прибыло!

Табло результатов — это интересный способ следить за вашими играми, все данные хранятся в вашем браузере. Скоро появятся новые функции!

Реклама · УДАЛИТЬ?
Реклама · УДАЛИТЬ?
Реклама · УДАЛИТЬ?

новости с техническими моментами

Примите участие

Помогите нам продолжать предоставлять ценные бесплатные инструменты

Купи мне кофе
Реклама · УДАЛИТЬ?