# .mkv MIME Type: video/matroska

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

- MIME type: `video/matroska`
- Extensions: .mkv
- Also seen as: `video/x-matroska`
- Content-Type header: `video/matroska`
- Compress in transit: no (already compressed)
- File signature: `1A 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`.

## Server configuration

### 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">
```

## FAQ

### 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

- [.webm — video/webm](https://www.devkult.com/mime/webm.md)
- [.mp4 — video/mp4](https://www.devkult.com/mime/mp4.md)
- [.avi — video/x-msvideo](https://www.devkult.com/mime/avi.md)

Open the interactive page: https://www.devkult.com/mime/mkv