Navigation

Working with NDJSON Files

Learn how to import, parse, and work with Newline-Delimited JSON (NDJSON) files for streaming data and log processing.

Last updated:

NDJSON (Newline-Delimited JSON) is a format commonly used for streaming data, log files, and large datasets where each line is a separate JSON object. DataLensia supports NDJSON natively.

๐Ÿšฉ What is NDJSON?

Unlike standard JSON, NDJSON stores one JSON object per line with no surrounding array brackets:

{"id": 1, "event": "login", "user": "alice", "timestamp": "2025-01-15T10:30:00Z"}
{"id": 2, "event": "purchase", "user": "bob", "timestamp": "2025-01-15T10:31:00Z"}
{"id": 3, "event": "logout", "user": "alice", "timestamp": "2025-01-15T10:45:00Z"}

This is equivalent to a JSON array but much easier to stream and append to.

๐Ÿ› ๏ธ Importing NDJSON in DataLensia

Method 1: Drag & Drop

  1. Navigate to the JSON Editor (or any tool page).
  2. Drag your .ndjson file into the upload area.
  3. DataLensia's parser automatically detects the NDJSON format and converts it into a standard JSON array.

Method 2: Paste

  1. Paste raw NDJSON text (one JSON object per line) into the editor.
  2. The parser auto-detects the format and converts it to an array.

๐Ÿ”„ What Happens After Import

Once imported, your NDJSON data becomes a standard JSON array:

[
  {"id": 1, "event": "login", "user": "alice", "timestamp": "2025-01-15T10:30:00Z"},
  {"id": 2, "event": "purchase", "user": "bob", "timestamp": "2025-01-15T10:31:00Z"},
  {"id": 3, "event": "logout", "user": "alice", "timestamp": "2025-01-15T10:45:00Z"}
]

From here, you can:

  • Explore your data in the Data Explorer table view.
  • Filter records using the filter panel (e.g., event equals "purchase").
  • Transform with the Transform Builder.
  • Visualize with flow diagrams or node graphs.

๐Ÿ“ค Exporting Back to NDJSON

  1. Open the Convert Tool.
  2. Select NDJSON from the Data formats category.
  3. Each array element is output as a separate line โ€” ready for streaming pipelines.

๐Ÿ’ก Use Cases

Use CaseWorkflow
Log analysisImport NDJSON logs โ†’ Filter by event type โ†’ Export subset
Streaming dataImport โ†’ Validate structure โ†’ Transform โ†’ Re-export as NDJSON
Large file handlingNDJSON is more memory-efficient to parse than large JSON arrays
ETL pipelinesImport NDJSON โ†’ Apply transforms โ†’ Export as SQL/CSV

โšก Performance

DataLensia uses Web Workers to parse NDJSON files without blocking the UI. Files with millions of lines are parsed in a background thread, with a progress bar showing the parsing status.


๐Ÿš€ Try it now

Drop an .ndjson file into the JSON Editor to see instant conversion to a structured JSON array.