Convert MKV to WebM — Free Online Tool
Convert MKV files to WebM using VP9 video and Opus audio — the codec combination natively supported by all modern browsers for HTML5 video playback. This tool runs entirely in your browser with no file uploads, and displays the exact FFmpeg command for processing files over 1GB locally.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MKV file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
MKV and WebM are both Matroska-based containers, but WebM enforces a strict codec subset: only VP9 (or VP8) for video and Opus or Vorbis for audio. Because MKV files typically carry H.264 or H.265 video with AAC or MP3 audio, this conversion almost always requires full re-encoding of both streams — the video is transcoded from H.264/H.265 to VP9, and the audio is transcoded to Opus. The VP9 encoder uses CRF-based quality targeting (CRF 33 by default) combined with the -b:v 0 flag to operate in pure quality-constrained mode rather than targeting a fixed bitrate. The resulting WebM file is ready for embedding in an HTML5 video tag without any JavaScript dependencies or plugin requirements.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — the open-source multimedia framework that handles the demuxing, decoding, encoding, and muxing pipeline for this MKV-to-WebM conversion. |
-i input.mkv
|
Specifies the input Matroska file. FFmpeg will demux all streams (video, audio, subtitles, chapters) from the MKV container and make them available for the encoding pipeline. |
-c:v libvpx-vp9
|
Selects the VP9 encoder for the video stream. VP9 is mandatory for WebM video (alongside the older VP8) and is the only codec accepted by the WebM container spec that provides modern compression efficiency comparable to H.265. |
-c:a libopus
|
Selects the Opus encoder for the audio stream, transcoding from whatever audio codec the MKV contained (typically AAC or MP3). Opus is the preferred audio codec for WebM, offering better compression than Vorbis and broader browser support than AAC in open-format contexts. |
-crf 33
|
Sets the Constant Rate Factor for the VP9 encoder to 33, targeting a moderate visual quality level. VP9's CRF scale runs from 0 (lossless) to 63 (lowest quality), and 33 is the recommended default for general web streaming — lower values like 24 or 20 produce higher quality at significantly larger file sizes. |
-b:a 128k
|
Sets the Opus audio bitrate to 128 kbps. At 128k, Opus delivers transparent or near-transparent quality for most stereo content — notably more efficient than AAC or MP3 at the same bitrate. |
-b:v 0
|
Sets the video bitrate target to zero, which is required to activate VP9's CRF quality mode. Without this flag, FFmpeg's VP9 encoder ignores the -crf value and falls back to a default fixed bitrate, making this flag essential for the CRF setting to have any effect. |
output.webm
|
Specifies the output filename with the .webm extension, which tells FFmpeg to use the WebM muxer. The WebM muxer enforces codec restrictions at the container level, rejecting any codec other than VP9/VP8 for video and Opus/Vorbis for audio. |
Common Use Cases
- Embedding a downloaded MKV movie clip or tutorial on a personal website or blog using a native HTML5 <video> tag without requiring a JavaScript player library
- Preparing MKV screen recordings or gameplay captures for upload to platforms that require WebM, such as certain web-based video editors or CMS platforms that reject H.264 files
- Converting MKV anime or film encodes to VP9/WebM to serve video efficiently on a self-hosted site, since VP9 typically achieves 30–50% better compression than H.264 at equivalent visual quality
- Converting an MKV file with multiple audio tracks for a web application that uses the WebM container's multi-track support to let users switch language tracks in the browser
- Packaging an MKV video as WebM for use in a Progressive Web App (PWA) where royalty-free, open codec compliance is required by the project's licensing constraints
- Reducing the file size of an MKV-based video for web delivery, taking advantage of VP9's superior compression efficiency over the H.264 codec commonly found in MKV files
Frequently Asked Questions
Yes — if your MKV contains H.264 or H.265 video and AAC audio (the most common case), this conversion requires full re-encoding of both streams, which is a lossy transcode. Each generation of lossy encoding introduces some quality loss. At CRF 33 with VP9, the output is generally visually acceptable for web streaming, but for archival purposes you should keep the original MKV. If your MKV already contains VP9 video and Opus audio, those streams could in theory be remuxed without re-encoding, but this tool applies full transcoding to ensure compatibility.
The VP9 encoder in FFmpeg requires both flags to operate in constrained quality mode. The -crf 33 flag sets the target quality level (lower numbers mean better quality), but without -b:v 0 the encoder defaults to a fixed bitrate mode and ignores the CRF value entirely. Setting -b:v 0 tells the encoder there is no bitrate ceiling, allowing it to allocate as many bits as needed to hit the CRF target on any given frame. This combination is the standard recommended approach for high-quality VP9 encoding.
WebM technically supports WebVTT subtitles and chapter markers within the container spec, but FFmpeg's WebM muxer has limited support for subtitle stream copying from MKV sources, and subtitle tracks are not included in this tool's default conversion command. Chapter metadata from the MKV is also not guaranteed to carry over. If you need subtitles, consider keeping the MKV for local playback and serving a separate .vtt sidecar file alongside the WebM for web use.
To improve video quality, lower the CRF value — for example, replace -crf 33 with -crf 24 or -crf 20 (valid VP9 CRF range is 0–63, where 0 is lossless). Be aware that lower CRF values produce larger files and significantly slower encodes with VP9. To increase audio quality, raise the -b:a value from 128k to 192k or 256k. For a two-pass VP9 encode (recommended for consistent quality on longer files), you would run FFmpeg twice: once with -pass 1 -an and once with -pass 2, which gives the encoder better bit distribution across the whole file.
Yes — on Linux or macOS, you can run: for f in *.mkv; do ffmpeg -i "$f" -c:v libvpx-vp9 -c:a libopus -crf 33 -b:a 128k -b:v 0 "${f%.mkv}.webm"; done. On Windows Command Prompt, use: for %f in (*.mkv) do ffmpeg -i "%f" -c:v libvpx-vp9 -c:a libopus -crf 33 -b:a 128k -b:v 0 "%~nf.webm". Note that VP9 encoding is CPU-intensive, so batch processing large MKV files will be slow — consider using the -speed flag (values 1–5) to trade quality for faster encoding.
File size differences depend heavily on what codec the MKV was using. If the original MKV used H.265 (HEVC), which is more efficient than VP9 at similar quality settings, the WebM output may actually be larger. If the MKV used older or higher-bitrate H.264 encoding, the VP9 output at CRF 33 may be noticeably smaller. The CRF 33 default is a moderate quality setting — if you want to match the original file size more closely, you can estimate the required bitrate of the original using ffprobe and then set -b:v to that value instead of using CRF mode.
Technical Notes
WebM's codec restrictions make MKV-to-WebM one of the heavier conversions in the Matroska family: unlike MKV-to-MKV remuxing or MP4 conversions where H.264 streams can be stream-copied, the WebM format mandates VP9 (or VP8) video and Opus or Vorbis audio, so full re-encoding is unavoidable in virtually all real-world MKV files. VP9 encoding is notably slower than H.264 or H.265 encoding at comparable quality — expect encode times 3–5× longer than an equivalent H.264 encode in FFmpeg. The -speed flag (0–5) can accelerate encoding at a quality cost, with -speed 4 being a common tradeoff for web production workflows. On the audio side, Opus is a modern, highly efficient codec that typically matches or exceeds AAC quality at the same bitrate, so the audio transcode is generally a quality-neutral or slight improvement step. MKV features like multiple audio tracks are preserved in WebM if explicitly mapped with -map flags, but the default FFmpeg behavior selects only the best single video and audio stream. HDR metadata (HDR10, HLG) present in an MKV's VP9 or HEVC stream can in principle be carried through to WebM/VP9, but requires explicit color metadata flags and browser-side HDR support to render correctly. Transparency (alpha channel) is a WebM/VP9 feature not available in standard MKV/H.264, so this conversion cannot add transparency that wasn't present in the source.