application/x-ndjson

All MIME types
Application · Unregistered tree.ndjson .jsonl

Media type / application

application/x-ndjson

Newline-delimited JSON: one complete JSON value per line, so a consumer can process a huge dataset without holding it all in memory.

Served inline: Browsers have no renderer for this, so it downloads even without a Content-Disposition header. That makes it the quiet default for anything you do not want opened in place.

Browser behaviour

Downloads

Charset

charset ignored

Compression

Compress in transit

Send it like this

Content-Type: application/x-ndjson

The format defines its own encoding, so no charset parameter is registered for this type. Sending one is harmless, but receivers are required to ignore it — it is not doing what people think it does.

Handling verdict

InlineDownloads

Browsers have no renderer for this, so it downloads even without a Content-Disposition header. That makes it the quiet default for anything you do not want opened in place.

Charsetcharset ignored

The format defines its own encoding, so no charset parameter is registered for this type. Sending one is harmless, but receivers are required to ignore it — it is not doing what people think it does.

CompressionCompress in transit

The payload is text-like or otherwise repetitive, so gzip or Brotli removes real bytes. Enable it at the server or CDN.

NameUnregistered tree

An `x-` prefix marks a type that was never registered. RFC 6838 discourages new ones, but several — like application/x-www-form-urlencoded — are now too widespread to change.

Anatomy of the name

RFC 6838

Top-level type

application

Application

Subtype

x-ndjson

Registered in the unregistered tree.

Structured syntax

none

No suffix, so the payload format is defined entirely by the subtype itself.

Parameters

none

Beyond the charset rule above, this type defines no parameters of its own.

What trips people up

1 note
  • Unregistered, hence the x- prefix; application/jsonl and .jsonl are the other common spellings.

Response headers

Content-Type: application/x-ndjson
X-Content-Type-Options: nosniff
Content-Disposition: attachment; filename="example.ndjson"
Vary: Accept-Encoding

nosniff stops the browser second-guessing the type you declared, which is what makes the rest of this reliable. Content-Disposition: attachment names the saved file and removes any doubt about rendering.

Server configuration

extension mapping

nginx

types {
    application/x-ndjson  ndjson jsonl;
}

Apache

AddType application/x-ndjson .ndjson .jsonl

Caddy

@type path *.ndjson *.jsonl
header @type Content-Type "application/x-ndjson"

Extensions and other spellings

declared

File extensions

.ndjson.jsonl

Also written as

application/jsonlapplication/x-jsonlines

These reach the same handler in practice. Accept them on input; send application/x-ndjson on output.

File signature

No fixed signature — this format has no reliable magic number, so identify it by parsing rather than by the first few bytes.

Related media types

8
Familyapplication
Treeunregistered
Suffix
Inlinedownload