← Blog dev

The world's most popular web server still serves .js with the wrong MIME type

Scan to open this page

The world's most popular web server still serves .js with the wrong MIME type

Before building MIME Type Lookup, we checked what the current spec actually says about the MIME type for JavaScript files — and found the two "obvious" answers online contradicted each other.

The spec settled this in 2022. Not everyone caught up.

We confirmed directly against MDN's reference: the current standard, per RFC 9239 and the HTML Living Standard, is text/javascript for .js files — not application/javascript. But nginx, the most widely deployed web server on the internet, has an open issue (Trac #1407) about its own default mime.types file still shipping the older application/javascript value. A huge number of production servers are, right now, technically out of date with the spec by default. A lookup tool that only shows one of these two values is telling you half the story either way.

One extension, more than one value in the wild

It's not just .js. .mp3 is standardly audio/mpeg, but audio/mp3 shows up constantly. .jpg is image/jpeg, but older tooling sometimes reports image/pjpeg. This tool shows the standard value first, and lists genuine alternates alongside it instead of pretending only one answer exists.

What happens when the extension isn't in any table?

Most lookup tools just come up empty for an extension they don't recognize. This one explains what actually happens next: unregistered extensions conventionally fall back to application/octet-stream — generic binary data, which usually triggers a download instead of rendering inline.

Try MIME Type Lookup →

#MimeTypeLookup#MimeTypeForFileExtension#Application/javascriptVsText/javascript#UnknownFileExtensionMimeTypeFallback#MimeTypeReverseLookupExtension