What is MIME type "application/x-matroska"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

application/x-matroska is the MIME type for the Matroska container format.
It holds different media streams like video, audio, and text in one file.
Files using this type include formats such as MKV, MKS, MKA, and MK3D.
Developers and media enthusiasts use it for archiving, streaming, and high-quality playback.
Learn more on the Matroska official website.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: application/x-matroska    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="application/x-matroska">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'application/x-matroska');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

Is application/x-matroska the correct MIME type for MKV video files?

It is a valid MIME type for the container, but video/x-matroska is generally preferred for video content intended for playback. Using application/x-matroska treats the file as a generic application data stream, which may cause browsers to download the file rather than playing it in the HTML5 video player.

How do I configure Apache to serve application/x-matroska files?

You can add the MIME type definition to your .htaccess file or main configuration. Add the line: AddType application/x-matroska .mkv .mka .mks. If you specifically want in-browser playback, consider using AddType video/x-matroska .mkv instead.

Does Nginx support application/x-matroska by default?

Nginx may not include this type in its default mime.types file. To add it, open your configuration and inside the types block add: application/x-matroska mkv mka;. Reload Nginx to apply the changes.

Why does my MKV file download instead of playing in the browser?

This often happens because the server is sending the application/x-matroska header, which indicates a generic file, rather than a specific media type. To fix this, change the MIME type to video/x-matroska (for video) or audio/x-matroska (for MKA audio), and ensure the browser supports the internal codecs (like VP9 or H.264).

Which web browsers support playing Matroska files natively?

Browser support for Matroska is inconsistent compared to MP4. Google Chrome and Mozilla Firefox generally support MKV playback if the underlying codecs are supported. However, Safari (on iOS and macOS) often does not support the Matroska container natively.

What is the difference between application/x-matroska and video/x-matroska?

application/x-matroska describes the generic container format, which can hold video, audio, or subtitles (like MKS). video/x-matroska is specific to files containing video streams. Web developers should use the video/ prefix to hint to the browser that the content is visual media.

Can application/x-matroska be used for 3D video files?

Yes, the Matroska format supports stereoscopic 3D video, often using the .mk3d extension. While application/x-matroska covers this, specialized players might look for video/x-matroska-3d or simply rely on the file header metadata to detect the 3D format.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.