Convert MKV to HEVC — Free Online Tool

Convert MKV files to raw HEVC/H.265 bitstream format, re-encoding the video using libx265 for maximum compression efficiency. HEVC delivers the same perceptual quality as H.264 at roughly half the bitrate, making it ideal for archiving high-resolution MKV content with significantly reduced file sizes.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

This conversion extracts the video stream from your MKV container and fully re-encodes it using the libx265 encoder, producing a raw HEVC bitstream (.hevc) file. Unlike a simple remux, every frame is decoded and re-compressed using H.265's more sophisticated compression algorithms — this is computationally intensive but yields substantially smaller files. The output is a containerless raw video bitstream, meaning all audio tracks, subtitle streams, chapter markers, and metadata present in the MKV are discarded. Only the re-encoded video survives. The default CRF of 28 is used, which is the libx265 equivalent of H.264's CRF 23 in terms of perceptual quality — because H.265 is simply a more efficient codec, not because quality is reduced.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg tool. In this browser-based tool, FFmpeg runs entirely client-side via WebAssembly (FFmpeg.wasm), so no file data is transmitted to any server.
-i input.mkv Specifies the input Matroska file, which may contain any combination of video, audio, subtitles, and chapter data. FFmpeg will demux all streams, but only the video stream will be used in this conversion.
-c:v libx265 Sets the video encoder to libx265, the open-source H.265/HEVC encoder. This triggers a full re-encode of the video stream — every frame from the MKV is decoded and re-compressed using H.265's superior compression algorithms rather than simply being copied.
-crf 28 Sets the Constant Rate Factor to 28, which is the recommended default quality level for libx265. This value is perceptually equivalent to CRF 23 in H.264 encoding, balancing file size and visual quality. Lower values produce higher quality at larger file sizes; higher values compress more aggressively.
-x265-params log-level=error Passes the log-level=error parameter directly to the internal x265 encoding library, suppressing the verbose per-frame statistics that libx265 normally prints to the console. This has no effect on the encoded output — it only keeps FFmpeg's terminal output clean.
output.hevc Defines the output as a raw HEVC elementary bitstream file. The .hevc extension signals to FFmpeg to write a containerless H.265 bitstream with no audio, subtitles, chapters, or metadata — only the compressed video frames.

Common Use Cases

  • Archive a large MKV movie collection by re-encoding to HEVC, cutting storage requirements nearly in half while maintaining the same visual quality for 4K or 1080p content
  • Prepare a raw HEVC bitstream for ingestion into a custom video pipeline or hardware encoder workflow that requires containerless H.265 input
  • Re-encode a high-bitrate MKV recorded from a capture card or camera to HEVC to reduce file size before editing or long-term storage
  • Extract and compress only the video component of a multi-track MKV (e.g., a Blu-ray remux with multiple audio tracks and subtitles) into a compact HEVC stream
  • Test and compare libx265 encoding quality at various CRF values against the original MKV source for encoding research or quality benchmarking
  • Convert an MKV containing an H.264 video stream to HEVC to meet delivery requirements for platforms or devices that mandate H.265 video

Frequently Asked Questions

The raw HEVC bitstream format (.hevc) is not a container — it is a pure, headerless video stream with no support for multiplexed audio, subtitle tracks, chapter markers, or metadata. All of those elements live in the MKV container and have no place in a raw bitstream. If you need to preserve audio and subtitles alongside H.265 video, you should target a container format like MKV or MP4 with libx265 as the video codec instead.
At CRF 28 (the libx265 default), the output is perceptually very close to the original but is technically a lossy re-encode, so some generation loss occurs. The H.265 codec is significantly more efficient than H.264, so a CRF 28 HEVC file typically looks comparable to a CRF 23 H.264 file at a much smaller file size. If the source MKV already used libx265, re-encoding again will compound quality loss, and in that case you should lower the CRF value toward 18–20 to compensate.
File size reduction depends on the codec used in the source MKV. If the MKV contains H.264 video, you can expect the HEVC output to be roughly 40–50% smaller at equivalent perceptual quality. If the source already uses H.265, the size reduction will be minimal and the re-encode mainly introduces additional quality loss. Keep in mind the .hevc file also strips all audio, which can account for a significant portion of the original MKV's size.
Adjust the -crf value to control quality. Lower CRF values produce higher quality and larger files — CRF 18 is near-visually lossless for most content, while CRF 0 is mathematically lossless. Higher values like CRF 35 or 40 produce smaller files with more visible compression artifacts. For archiving high-resolution content from MKV sources, CRF 22–26 is a common range that balances quality and size better than the default CRF 28. The full adjusted command would look like: ffmpeg -i input.mkv -c:v libx265 -crf 22 -x265-params log-level=error output.hevc
By default, libx265 prints verbose encoding statistics and progress information directly to the console, which can be noisy and confusing when running FFmpeg. The -x265-params log-level=error flag passes an internal parameter to the x265 encoder library, suppressing all output except actual error messages. This keeps the FFmpeg terminal output clean and readable without affecting the encoding process or output quality in any way.
Yes. On Linux or macOS, you can run a shell loop: for f in *.mkv; do ffmpeg -i "$f" -c:v libx265 -crf 28 -x265-params log-level=error "${f%.mkv}.hevc"; done. On Windows Command Prompt, use: for %f in (*.mkv) do ffmpeg -i "%f" -c:v libx265 -crf 28 -x265-params log-level=error "%~nf.hevc". Be aware that libx265 encoding is CPU-intensive, so batch processing many large MKV files will take considerable time on most machines.

Technical Notes

The output of this conversion is a raw HEVC elementary stream, identified by the .hevc extension. Unlike container formats such as MKV or MP4, a raw bitstream carries no timing information, index, or wrapper — some players and tools may struggle to open it directly, and seeking within the file may not work correctly. Tools like VLC can typically play raw HEVC streams, but for broad compatibility you would normally mux the stream into a container afterward using ffmpeg -i output.hevc -c:v copy final.mp4. The libx265 encoder supports both lossy encoding (via CRF) and lossless encoding (CRF 0), and also supports HDR content including HDR10 and Dolby Vision passthrough when the source MKV carries the appropriate HDR metadata — though HDR metadata preservation in a raw bitstream depends on the encoder correctly embedding SEI NAL units. One important limitation: because this is a full re-encode rather than a stream copy, encoding time scales significantly with resolution and duration. A 4K MKV file can take many times longer to encode than real-time on consumer hardware without GPU acceleration. The browser-based tool uses FFmpeg.wasm running on the CPU, so very large or long files are better handled by copying the displayed FFmpeg command and running it locally.

Related Tools