keepcalculator

06 Numbers and Powers

H264 vs HEVC: Which Codec Should You Use?

Card No. 06·78839 · Updated · Standard formula, shown below

H.264 and HEVC (H.265) are both video compression standards, but HEVC offers roughly double the compression efficiency of H.264 at the same visual quality. If you’re choosing between them for a new project, use HEVC when file size or streaming bandwidth matters most and your devices support it; use H.264 for maximum compatibility with older hardware and software.

Background: What Are H.264 and HEVC?

H.264 (also called AVC, Advanced Video Coding) was finalized in 2003 and became the universal standard for video—used in Blu-ray, streaming, video conferencing, and virtually every camera. It was a massive leap over MPEG-2, offering similar quality at about half the bitrate.

HEVC (High Efficiency Video Coding, also known as H.265) was finalized in 2013. Its main goal was to halve the bitrate needed for the same visual quality as H.264. It achieves this with more advanced tools like larger coding tree units (up to 64×64 pixels vs. 16×16 for H.264), better intra-prediction, and improved motion compensation.

How the Compression Works

Both codecs compress video by removing spatial and temporal redundancy. Spatial redundancy means similar colors within a frame; temporal redundancy means unchanged areas between frames. Instead of storing every pixel, the encoder stores the differences and motion vectors.

HEVC’s improvements come from its more flexible partitioning. It can use larger blocks for smooth areas and smaller blocks for detail, adapting more efficiently. It also has 33 directional intra-prediction modes (vs. 9 for H.264) and better deblocking filters, which reduce artifacts at low bitrates.

Compatibility: The Biggest Trade-off

H.264 is supported by virtually every device, browser, and player. HEVC is not. While most modern smartphones, smart TVs, and graphics cards (since around 2015-2016) support HEVC decoding, many older devices and some web browsers do not. For example, Chrome and Firefox support HEVC only on devices with hardware decoding, whereas H.264 works everywhere. If you’re distributing video to a broad audience, H.264 is the safe choice. If you control the playback environment (e.g., a mobile app or a closed system), HEVC can save significant bandwidth.

File Size and Quality: How Much Do You Save?

In practice, HEVC typically delivers the same quality as H.264 at 40% to 60% lower bitrate. This means a 1 GB H.264 file could be around 500 MB in HEVC. For streaming services, that translates to lower bandwidth costs and faster buffering for users. For storage, it means more footage on an SD card or hard drive.

However, the gains are not always equal. High-motion content (sports, action scenes) may show less savings, while slow, static content (talking heads, screen recordings) can show more. Also, HEVC encoding is computationally heavier—it takes more time and power to encode, and older devices may struggle to play it smoothly.

How to Choose: Which Codec Should You Use?

  • Use H.264 if: you need maximum compatibility, your target audience uses older devices, you’re uploading to a platform that re-encodes anyway (like YouTube), or you’re doing real-time streaming with limited CPU.
  • Use HEVC if: you control the playback environment, you’re storing video locally (e.g., iPhone recordings), you’re streaming to modern smart TVs, or you need to save bandwidth and storage costs.
  • Consider alternatives: AV1 (newer, even better compression, but slow to encode) and VP9 (used by YouTube) are also options for web streaming.

Common Problems and Misconceptions

“HEVC is always better.” Not if your device can’t play it. A file that won’t play is useless.

“H.264 is old and obsolete.” It’s still the most widely supported codec in the world. New codecs take years to achieve universal adoption.

“HEVC has licensing issues.” Yes, HEVC is patent-encumbered, and royalty fees can apply, but for most users, the cost is already included in their software or device. For content creators, it’s rarely a blocker.

Costs and Hardware Support

Encoding HEVC requires more CPU power. Real-time encoding on a laptop may not be feasible without hardware acceleration. Most modern GPUs (NVIDIA GTX 950 and newer, AMD Radeon RX 400 series and newer) include dedicated HEVC encoders/decoders. If your hardware doesn’t support HEVC, software decoding will work but may cause high CPU usage and battery drain.

Frequently Asked Questions

Is HEVC better than H.264 for YouTube?

YouTube accepts both, but it re-encodes your upload anyway. Uploading in H.264 is fine and compatible; uploading in HEVC might preserve slightly more detail in the original, but the final output is the same for viewers.

Can I convert H.264 to HEVC without quality loss?

Lossless transcoding is impossible—re-encoding always introduces some generational loss. However, converting from a high-bitrate H.264 file to HEVC at a lower bitrate can produce visually identical quality with a smaller file.

Why is HEVC not supported in some browsers?

Browser support depends on licensing and hardware. HEVC requires a patent license, and many browsers avoid paying fees. Also, software decoding is inefficient, so browsers rely on hardware support, which not all devices have.

Which codec does iPhone use?

iPhones record video in HEVC (H.265) by default since iOS 11, but you can switch to H.264 in Settings > Camera > Formats for better compatibility.

What is AV1 and how does it compare?

AV1 is a newer, royalty-free codec that offers about 30% better compression than HEVC. It’s supported by newer GPUs and browsers, but encoding is very slow, making it less practical for real-time use.

Does HEVC use more battery when playing video?

If your device has hardware HEVC decoding, it uses less battery than H.264 because it processes fewer bits. Without hardware support, software decoding uses significantly more battery.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →