Matroska got its name from Russian nesting dolls (matryoshka), and the metaphor is perfect: an MKV file can contain anything inside anything. Multiple video tracks, a dozen audio tracks in different languages, ten subtitle tracks in different formats, chapter markers, cover art, and arbitrary metadata attachments — all in one file.
Where MP4 is the format designed for universal playback, MKV is the format designed for completeness. It's what you use when you need every audio commentary track, every subtitle language, and every chapter marker preserved exactly as they are. Media servers like Plex and Jellyfin treat MKV as a first-class citizen precisely because of this flexibility.
The tradeoff is simple: MKV doesn't play in browsers. If you need web playback or social media uploads, you'll need to convert MKV to MP4. But for everything else, MKV is the most capable container format available.
What Makes MKV Different from MP4
Both MKV and MP4 are container formats that hold compressed streams. The difference is in what they're willing to hold and how they organize it.
| Feature | MKV | MP4 |
|---|---|---|
| Video codecs | Any (H.264, H.265, VP9, AV1, MPEG-2, DivX, Theora, etc.) | H.264, H.265, AV1 (officially) |
| Audio codecs | Any (AAC, FLAC, DTS, TrueHD, Opus, Vorbis, PCM, etc.) | AAC, MP3, AC-3, ALAC |
| Subtitle formats | SRT, ASS/SSA, VobSub, PGS, VTT, and more | tx3g (3GPP Timed Text) only |
| Chapter markers | Full chapter support with nested chapters | Basic chapter support |
| Multiple tracks | Unlimited video, audio, subtitle tracks | Multiple tracks possible but inconsistent player support |
| Attachments | Fonts, images, any file type | Cover art only |
| Browser playback | Not supported natively | Universal |
| Streaming | Not designed for HTTP streaming | DASH/HLS via fragmented MP4 |
EBML: The Foundation
MKV is built on EBML (Extensible Binary Meta Language), a binary XML-like format. Where MP4 uses fixed atom types, EBML allows new element types to be defined without breaking backward compatibility. This is why MKV can absorb new codecs and features without format revisions.
The key EBML elements in an MKV file:
- Segment — The root container holding everything
- SeekHead — An index of where other elements are in the file (like MP4's moov)
- Info — Duration, title, muxing application, timestamp scale
- Tracks — Codec IDs, dimensions, sample rates for each track
- Clusters — The actual compressed data, organized in time-ordered groups
- Chapters — Named time ranges with nested hierarchy support
- Tags — Freeform metadata (title, director, year, etc.)
- Attachments — Embedded files (fonts for ASS subtitles, cover art, etc.)
Codec Flexibility: Why MKV Holds Anything
MKV doesn't restrict which codecs you can use. The format specification defines codec IDs (like V_MPEG4/ISO/AVC for H.264 or A_FLAC for FLAC), and new IDs can be registered at any time. This is fundamentally different from MP4, where codec support is defined by the ISO specification and adding new codecs requires formal standardization.
In practice, this means:
- FLAC audio in MKV: Lossless audio without transcoding. MP4 doesn't support FLAC — you'd need to convert to ALAC (Apple's lossless) or AAC (lossy). MKV just wraps the FLAC stream directly.
- DTS and TrueHD: Surround sound codecs from Blu-ray discs. MKV preserves these natively. MP4 has limited DTS support and no TrueHD support.
- Legacy codecs: MPEG-2 from DVDs, DivX/Xvid from the early 2000s, even RealVideo — MKV handles them all. This makes MKV the archival format of choice.
- Multiple video tracks: 3D video with separate left/right eye streams, or multiple angles from the same event. MKV supports this natively.
Subtitles: Where MKV Truly Shines
MKV's subtitle support is unmatched. You can embed any of these subtitle formats as soft subtitles (toggleable, not burned into the video):
- SRT — Plain text with timestamps. Simple, universal, small files.
- ASS/SSA — Styled subtitles with fonts, colors, positioning, animations. Used extensively in anime fansubs. MKV can also embed the required fonts as attachments, so styled subtitles display correctly on any system.
- VobSub — Bitmap-based subtitles from DVDs. Each subtitle is a small image, not text. MKV preserves these perfectly.
- PGS (Presentation Graphic Stream) — Bitmap subtitles from Blu-ray discs. Like VobSub but higher resolution.
- VTT (WebVTT) — Web-standard text subtitles. Useful if you're converting from web sources.
The key advantage: MKV preserves subtitle formatting that MP4 cannot. When you convert MKV to MP4, ASS-styled subtitles either get flattened to plain text (losing all styling) or burned into the video (losing the ability to toggle them). If subtitle fidelity matters, stay in MKV.
Extract subtitles from MKV: MKV to SRT | MKV to VTT
Chapters and Metadata
MKV chapters are more powerful than any other container's chapter implementation:
- Nested chapters — Chapters can contain sub-chapters (e.g., "Act 1" containing "Scene 1," "Scene 2," etc.)
- Multi-language chapter names — Each chapter can have names in multiple languages simultaneously
- Chapter codec — Chapters can have associated codec data, enabling features like chapter-specific thumbnails
- Ordered chapters — Chapters can reference external segments, allowing a single MKV to seamlessly combine segments from multiple files
MKV tags are similarly flexible: freeform key-value pairs that can be attached to the file, individual tracks, or specific chapters. Title, director, year, genre, ratings, production notes — anything can be stored. Media servers like Plex read MKV tags to populate their library metadata.
MKV and Media Servers
Plex, Jellyfin, Emby, and Kodi all treat MKV as their preferred format. The reason is practical: MKV is the output format of Blu-ray and DVD ripping tools (MakeMKV, HandBrake), and it preserves everything from the original disc — all audio tracks, all subtitles, all chapters.
When a media server plays an MKV file, it does one of three things:
- Direct Play — The client device supports the codecs inside the MKV. No processing needed. This is ideal.
- Direct Stream — The client supports the codecs but not the MKV container. The server remuxes the streams into MP4 on the fly. Fast and lossless.
- Transcode — The client doesn't support the codecs. The server re-encodes in real-time. CPU-intensive, potential quality loss.
For the best Plex/Jellyfin experience: MKV with H.264 video, AAC or AC-3 audio, and SRT subtitles. This combination direct-plays on virtually every client. H.265 in MKV triggers transcoding on older clients, which can overwhelm the server CPU.
Why Browsers Don't Play MKV
No browser supports MKV natively. Chrome, Firefox, Safari, and Edge all refuse to play .mkv files in the <video> tag. This isn't a technical limitation — MKV can hold exactly the same H.264+AAC streams that browsers play in MP4 every day. It's a standardization choice: browsers standardized on MP4 and WebM, and there was no push to add a third container format.
This means MKV is unsuitable for:
- Web embedding
- Social media uploads (YouTube, Instagram, TikTok all reject MKV)
- Email attachments (recipients may not have a player that handles MKV)
- HTML5 video players
The fix is straightforward: convert MKV to MP4. If the MKV contains H.264 video and AAC audio, this is a remux — it takes seconds and preserves quality perfectly. If it contains other codecs (VP9, DTS, FLAC), re-encoding is needed. For web delivery, MKV to WebM is another option if the video is already VP9/AV1.
Converting MKV Files
MKV to MP4 (most common): If the codecs are MP4-compatible (H.264/H.265 + AAC), this is a fast remux. If not, re-encoding to H.264+AAC is needed. Convert MKV to MP4.
MKV to WebM: Requires re-encoding to VP9+Opus unless the MKV already contains those codecs. Convert MKV to WebM.
MKV to AVI: Legacy use only. AVI lacks most of MKV's features (no soft subtitles, limited audio tracks). Convert MKV to AVI.
MP4/MOV/AVI to MKV: Almost always a remux, since MKV accepts any codec. MP4 to MKV | MOV to MKV | AVI to MKV.
Audio extraction: MKV to MP3 | MKV to FLAC | MKV to AAC.
MKV exists because MP4 couldn't hold everything. If you need a single file with multiple audio languages, styled subtitles with embedded fonts, Blu-ray quality DTS audio, and chapter markers — MKV is the only container that does all of it without compromise.
The practical advice is simple: use MKV for storage and local playback, MP4 for sharing and streaming. Converting between them is fast when the codecs overlap (which they usually do). Keep your master files in MKV where nothing gets lost, and export MP4 copies when you need to send them into the wider world.