devkult_
tools30converters34
home/mime/.mkv

.mkv MIME type

Matroska videovideo

video/matroska

Matroska video, a container for almost any codec. RFC 9559 registered video/matroska in 2024.

MIME typevideo/matroska
Extensions.mkv
Also seen asvideo/x-matroska
Content-Typevideo/matroska
Compress in transit?No — already compressed
File signature1A 45 DF A3
the EBML header shared by WebM and Matroska

Good to know

  • Most servers and the file command still use video/x-matroska, Apache's stock config included. Accept both on upload.
  • Browsers don't officially support Matroska in <video>. If the codecs inside are browser-friendly, remux without re-encoding: ffmpeg -i in.mkv -c copy out.mp4.
  • Audio-only Matroska files use .mka and audio/matroska.

Serve .mkv files with the right type

The response header to send:

Content-Type: video/matroska

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

nginx (inside the types block in mime.types)
video/matroska mkv;
Apache (.htaccess or server config)
AddType video/matroska .mkv
Express
res.set("Content-Type", "video/matroska");
Python
import mimetypes

mimetypes.add_type("video/matroska", ".mkv")
HTML file input
<input type="file" accept=".mkv,video/matroska">

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.mkv | grep -i '^content-type:'
file --mime-type file.mkv

Frequently asked questions

What is the MIME type for .mkv files?

video/matroska. You may also see video/x-matroska, but video/matroska is the one to send.

What Content-Type header should a .mkv file be served with?

Content-Type: video/matroska. It's already compressed, so servers shouldn't gzip it.

How can I tell if a file is really a .mkv?

Check its bytes rather than the extension: MKV files start with 1A 45 DF A3 — the EBML header shared by WebM and Matroska. On the command line, file --mime-type name.mkv does this for you.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options