HTTPREF
← Back to MIME types

MIME Type

Newline-Delimited JSON

API

A format for streaming JSON objects separated by newlines.

MIME type reference, HTTP example, browser usage, common mistakes, and related content.

What is the application/ndjson MIME type?

The MIME type application/ndjson is used to tell browsers, APIs, and servers how a file or response body should be interpreted.

MIME stands for Multipurpose Internet Mail Extensions, and MIME types are now a standard part of HTTP responses and web content delivery.

When a browser or client receives a response with application/ndjson, it uses that information to decide how the content should be processed, rendered, downloaded, or executed.

Example

{"id":1,"name":"Alice"}
{"id":2,"name":"Bob"}
{"id":3,"name":"Charlie"}

HTTP example

HTTP/1.1 200 OK
Content-Type: application/ndjson
Content-Length: 1256

Common file extensions

.ndjson

Common use cases

  • Streaming large datasets
  • Log ingestion and structured log streaming
  • Efficient data pipelines
  • Real-time APIs

Common mistakes

  • Using the wrong MIME type for the file being served
  • Returning text/plain instead of application/ndjson
  • Forgetting required parameters like charset when relevant
  • Using a deprecated MIME type in older server configurations
  • Serving assets with a mismatched Content-Type header, causing browser parsing issues

How browsers use it

Browsers use the Content-Type response header to decide how a response should be handled. For example, HTML is rendered as a page, CSS is parsed as styles, JavaScript is executed as script, and images are displayed visually. If the MIME type is incorrect, the browser may refuse to load the file correctly or may treat it as plain text or a download instead.

Practical developer insight

application/ndjson lets systems process JSON data line by line instead of loading one large JSON array into memory. It is widely used in streaming APIs, logs, and data pipelines. In production, developers may also encounter the older non-standard media type application/x-ndjson.

Related MIME types