How to open .NDJSON files on Windows

To open .NDJSON files on Windows, open the .ndjson file in a text editor (for example, Notepad) to view the raw lines (each line is one JSON document).

Step-by-step instructions

  1. Open the .ndjson file in a text editor (for example, Notepad) to view the raw lines (each line is one JSON document).
  2. If you expected a “normal JSON file,” remember NDJSON is not a single JSON array; process it with a tool that supports newline-delimited JSON (one JSON value per line).

Common issues

“JSON parse error” when using a normal JSON parser

Many JSON parsers expect a single JSON document (often one object or one array). An NDJSON file contains multiple JSON texts separated by newlines, so a parser that expects one document may fail after the first line.

  1. Confirm the file is NDJSON: each line should be a complete JSON value (commonly an object).
  2. Use a reader/parser that supports NDJSON/newline-delimited JSON (line-by-line JSON streaming), or split the file by lines and parse each line separately.

A line isn’t valid JSON, breaking processing partway through

NDJSON requires each record to be valid JSON on a single line. If a record contains an unescaped newline inside a string or the line is truncated/corrupted, tools may fail at that line.

  1. Locate the failing line number (many tools report it) and inspect that specific line in a text editor.
  2. Fix or remove the malformed record; ensure embedded newlines in strings are properly escaped and each JSON value stays on one line.

The file opens as plain text, but looks “unformatted” or hard to read

NDJSON is optimized for streaming rather than human readability. Each line may be minified JSON with no indentation.

  1. Use a text editor with JSON formatting features to pretty-print individual lines (record-by-record).
  2. If you need a single JSON document, convert the lines into a JSON array with a tool/workflow that reads NDJSON and outputs standard JSON.

Wrong content type / MIME type expectations in an API or pipeline

NDJSON commonly uses the media type application/x-ndjson per the ndjson-spec, but this is not an IANA-registered subtype; some systems may expect something else or treat it as generic text.

  1. If you control the sender, set Content-Type to application/x-ndjson when interacting with systems that recognize the ndjson-spec convention.
  2. If you need a standardized alternative for streaming JSON, consider RFC 7464 JSON Text Sequences (application/json-seq) where supported.

Security note

NDJSON is plain text (no macros), but it is often used for large, untrusted data streams; malformed or adversarial JSON can trigger performance or memory issues in parsers—prefer streaming/line-by-line processing rather than loading the entire file at once.

Back to .NDJSON extension page