A specification for delimiting JSON objects with newlines in stream protocols and file storage.
NDJSON is a specification that defines how to format JSON objects by separating them with newlines, creating a stream-friendly data format. It solves the problem of transporting multiple JSON instances through streaming protocols like TCP or UNIX pipes, where traditional JSON arrays or complex protocols like WebSockets are impractical. The format is also useful for storing semi-structured data in files.
Developers and system architects working with streaming data pipelines, log processing systems, or applications requiring efficient JSON transmission over network protocols. Data engineers who need to store or exchange large volumes of JSON records also benefit from this format.
Developers choose NDJSON because it provides a simple, standardized approach to JSON streaming that's more lightweight than alternatives like WebSockets. Its strict specification ensures interoperability across different systems while maintaining the flexibility to handle continuous data flows efficiently.
Specification
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Each JSON object is separated by a newline, making it ideal for continuous data streams over protocols like TCP or UNIX pipes, as specified in section 3.1.
Conforms to RFC 8259 for JSON and mandates UTF-8 encoding, ensuring broad interoperability and compatibility across systems.
Parsers accept both \n and \r\n delimiters and can be configured to handle empty lines, providing adaptability for different environments per section 3.2.
Offers a lightweight, well-defined standard that avoids unnecessary complexity, prioritizing simplicity for JSON streaming without overhead.
The spec only recommends raising errors on malformed lines without standardized recovery, which can disrupt entire streams if a single line is invalid.
Each line is a standalone JSON object with no built-in way to include metadata about the stream itself, requiring custom extensions for context.
While standardized, libraries and tools for NDJSON are less widespread compared to formats like CSV or JSON arrays, potentially increasing implementation effort.