# MKVToolNix

Canonical URL: https://encode.wiki/tools/utilities/mkvtoolnix/
Content version: ca42e61ede0a24f789d7287a0001244ad22f4abf
Status: current
License: CC BY-SA 4.0
Checksum (SHA-256): 0176ed798b2042580225909a3324110b8c53d3775a82415ff09a92403b1b47f9

> **Repository:** [mbunkus/mkvtoolnix](https://codeberg.org/mbunkus/mkvtoolnix). Creating and working with Matroska files. Latest tag: [release-102.0](https://codeberg.org/mbunkus/mkvtoolnix/src/tag/release-102.0), Sep 14, 2026. Last commit: Sep 28, 2026. Stars: 98.

MKVToolNix, by Moritz Bunkus, is the reference toolkit for [Matroska](/containers/matroska/) and [WebM](/containers/webm/). It is what most encoders use for the last step of a job: putting the encoded video, audio, subtitles, fonts and chapters together into one `.mkv`. It never re-encodes anything, so every operation is lossless and fast.

| Tool             | Does                                                                                    |
| ---------------- | --------------------------------------------------------------------------------------- |
| MKVToolNix GUI   | Front end for all of the below; most people use its multiplexer and header editor tabs. |
| `mkvmerge`       | Muxes, remuxes, splits and appends files. Reads MKV, MP4, raw streams, IVF, Blu-ray playlists and more. |
| `mkvextract`     | Extracts tracks, attachments, chapters, tags and timestamps.                            |
| `mkvpropedit`    | Edits titles, track languages, names and flags in place, without remuxing.              |
| `mkvinfo`        | Shows the element structure of a file.                                                  |

## Install it

The [downloads page](https://mkvtoolnix.download/downloads.html) has a Windows installer and portable archive, macOS disk images, an AppImage, and repositories for Debian, Ubuntu, Fedora and other distributions. It is also on [Flathub](https://flathub.org/apps/org.bunkus.mkvtoolnix-gui) and in most distribution repositories. Releases are frequent; distribution packages may trail by a few versions.

## Using the GUI

<picture>
  <source srcset="/media/content/3a320323bf70be8b-mkvtoolnix-gui-workload.avif" type="image/avif" />
  <img src="/media/content/fc87a1b6aec352e5-mkvtoolnix-gui-workload.webp" alt="MKVToolNix GUI multiplexer tab" />
</picture>

Drag files into the **Multiplexer** tab, untick the tracks you do not want, set language, name and the default/forced flags for each track, choose the output file and click **Start multiplexing**. Useful features:

- Open a Blu-ray playlist (`.mpls`) or `index.bdmv` from an unencrypted disc folder to import a title with all its segments.
- **Output → Splitting** cuts by duration, size, timestamps, chapters or frame ranges without re-encoding.
- The **Output** tab's "Create WebM compliant file" option restricts the output to WebM.
- The **Header editor** tab changes titles, languages and flags in an existing file instantly, without remuxing.
- The **Multiplexer** menu can show the equivalent `mkvmerge` command line, handy for scripting.

## mkvmerge

List the tracks and their IDs first. mkvmerge numbers tracks from 0 within each file; these IDs are not FFmpeg's stream indexes.

```sh
mkvmerge -i input.mkv
mkvmerge -J input.mkv
```

`-J` prints full details as JSON.

Options before a file name apply to that file only. This muxes an encoded video, an Opus track and ASS subtitles with a font:

```sh
mkvmerge -o output.mkv video.ivf --language 0:ja audio.opus --language 0:en --track-name 0:"English" subs.ass --attach-file font.ttf
```

Keep or drop tracks from a source with `-d`/`-a`/`-s` (video/audio/subtitle IDs to keep) or `-D`/`-A`/`-S` (drop all of that type). For example, to keep the video, only audio track 2 and no subtitles:

```sh
mkvmerge -o output.mkv -a 2 -S input.mkv
```

The most-used options:

| Option                                    | Use                                                                                       |
| ----------------------------------------- | ----------------------------------------------------------------------------------------- |
| `--language ID:LANG`                      | Track language as a BCP 47 tag (`en`, `ja`, `pt-BR`).                                     |
| `--track-name ID:NAME`                    | Track title shown by players.                                                             |
| `--default-track-flag ID:0` / `:1`        | Whether players pick this track by default.                                               |
| `--forced-display-flag ID:1`              | Marks a subtitle track as forced (for example, signs and foreign-language dialogue only). |
| `--sync ID:MS`                            | Delays (positive) or advances (negative) a track by milliseconds.                        |
| `--default-duration ID:24000/1001fps`     | Overrides the frame rate of a raw video stream with no timing of its own.                 |
| `--attach-file FILE`                      | Attaches a file, typically a font used by ASS subtitles.                                  |
| `--chapters FILE`                         | Adds chapters from an XML or simple `CHAPTER01=` text file.                               |
| `--split ...`                             | Splits the output (see below).                                                            |
| `--webm`                                  | Produces a WebM file and rejects codecs WebM does not allow.                              |
| `--title TEXT`                            | Sets the file's title.                                                                    |

### Split and join

```sh
mkvmerge -o part.mkv --split duration:00:20:00 input.mkv
mkvmerge -o clip.mkv --split parts:00:01:00-00:02:30 input.mkv
mkvmerge -o episode.mkv --split chapters:all input.mkv
mkvmerge -o joined.mkv part1.mkv + part2.mkv
```

A split can only happen right before a keyframe, so each cut moves to the first keyframe at or after the point you asked for: clean, but not frame-exact; numbered files (`part-001.mkv`, …) are created when there is more than one part. A `+` before a file appends it to the previous one, which requires matching codecs and parameters.

## mkvextract

```sh
mkvextract input.mkv tracks 0:video.ivf 1:audio.opus 2:subs.ass
mkvextract input.mkv attachments 1:font.ttf
mkvextract input.mkv chapters chapters.xml
mkvextract input.mkv timestamps_v2 0:timestamps.txt
```

Tracks come out as their raw bitstream; pick an extension that matches the codec. Add `--simple` to the `chapters` mode for the plain `CHAPTER01=` format.

## mkvpropedit

Edits are written into the file in place and take seconds even on large files:

```sh
mkvpropedit input.mkv --edit info --set "title=My encode"
mkvpropedit input.mkv --edit track:a1 --set language=ja --set flag-default=1 --edit track:s1 --set flag-forced=1
```

`track:a1` is the first audio track, `track:s1` the first subtitle track and `track:v1` the first video track; these selectors count from 1 per type, unlike mkvmerge's IDs. mkvpropedit can also add, replace and delete attachments and chapters. The GUI's header editor does the same thing interactively.

## Related pages

- [Matroska](/containers/matroska/) and [WebM](/containers/webm/)
- [FFmpeg](/tools/utilities/ffmpeg/), [MP4Box](/tools/utilities/mp4box/) for MP4
- [Handle audio and subtitles](/guides/audio-and-subtitles/)
