H.264 vs H.265: what actually changes

H.264 (also called AVC) and H.265 (also called HEVC) are both video codecs — rules for compressing raw video into a much smaller stream and decompressing it again for playback. H.265 is the newer of the two and compresses more efficiently, but "newer and better" doesn't automatically mean "the right choice for every job."

What a codec is actually doing

Raw, uncompressed video is enormous: a single minute of 1080p footage at normal frame rates can run into gigabytes. A codec removes redundancy — both within a single frame (spatial compression, similar to how a photo format finds patterns in a picture) and between consecutive frames (temporal compression, since most of the image usually doesn't change from one frame to the next). The result is a stream that's a fraction of the original size but still looks close to the source when decoded.

Where H.265 gains efficiency

H.265 uses the same general approach as H.264 but with a more flexible toolkit. Where H.264 divides a frame into fixed 16×16 macroblocks, H.265 can use blocks ranging from 8×8 up to 64×64, which lets the encoder describe large flat areas (a clear sky, a plain background) with very little data while still spending detail where it's needed. It also has more prediction modes and a more advanced in-loop filter for smoothing block edges. The practical result, measured across most real-world content, is that H.265 can hit roughly the same visual quality as H.264 at somewhere around 40–50% lower bitrate — though the exact number depends heavily on the content and the encoder settings used on both sides.

What that efficiency costs

  • Encoding time. The extra flexibility in H.265 means the encoder has more options to evaluate for every block, so encoding typically takes noticeably longer than H.264 at a comparable quality setting, especially in software.
  • Decoding cost. Playback also takes more processing power. Most phones, TVs, and computers from the last several years include dedicated H.265 decoding hardware, but older or low-end devices may fall back to software decoding, which drains battery faster and can stutter on underpowered hardware.
  • Compatibility. H.264 is close to universally supported — every modern browser, device, and editing tool handles it without a second thought. H.265 support is broad but not universal, and browser support for H.265 playback varies more than it does for H.264, which matters if the video needs to play directly in a browser rather than through a native app.
Quick comparison
  H.264 / AVC H.265 / HEVC
Relative compression efficiency Baseline ~40–50% smaller at similar quality
Encoding speed Faster Slower, especially in software
Hardware decode support Extremely broad Broad on recent devices, patchy on older ones
Browser playback support Near-universal Inconsistent across browsers
Typical use today Web video, broad-reach delivery 4K/HDR content, storage-constrained archives, capable device targets

A practical way to decide

If the video needs to reach the widest possible audience with the least risk of playback problems — a public web page, an email attachment, something shared across unknown devices — H.264 remains the safer default. If the target audience is on modern hardware, the content is high resolution (4K and above) where file size savings add up quickly, or storage and bandwidth are the binding constraint, H.265 is usually worth the extra encoding time.

It's also common to encode in both: an H.264 version for compatibility and an H.265 (or newer) version offered to devices that support it, selected automatically by the player. This is the same idea covered in more detail on the adaptive streaming page.

Note: H.264 and H.265 are compression formats, not containers. The codec determines how the picture data is compressed; the container is the file format that wraps that compressed video together with audio, subtitles, and metadata.
← Back to all topics