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
- Navigate to the JSON Editor (or any tool page).
- Drag your
.ndjsonfile into the upload area. - DataLensia's parser automatically detects the NDJSON format and converts it into a standard JSON array.
Method 2: Paste
- Paste raw NDJSON text (one JSON object per line) into the editor.
- 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
- Open the Convert Tool.
- Select NDJSON from the Data formats category.
- Each array element is output as a separate line โ ready for streaming pipelines.
๐ก Use Cases
| Use Case | Workflow |
|---|---|
| Log analysis | Import NDJSON logs โ Filter by event type โ Export subset |
| Streaming data | Import โ Validate structure โ Transform โ Re-export as NDJSON |
| Large file handling | NDJSON is more memory-efficient to parse than large JSON arrays |
| ETL pipelines | Import 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.