How to Compress Video for the Web

By FileConvertLab

Before and after: 450 MB raw video reduced to 42 MB web-optimized MP4 with H.264 codec at 2 Mbps bitrate
Bar chart showing 450 MB file shrinking to 42 MB with compression settings panel showing codec H.264, resolution 720p, bitrate 2 Mbps

A 450 MB video takes over 4 minutes to load on a mobile connection. The same content compressed properly fits in 40–50 MB and starts playing in seconds.

The difference isn't quality — it's choosing the right codec, resolution, and bitrate for web delivery.

Three settings control web video file size: resolution (how many pixels), bitrate (how much data per second), and codec (how efficiently data is compressed). Get these right and you can cut file size by 80–90% with no visible quality loss.

Resolution: Match Your Use Case

Higher resolution means more pixels — and exponentially more data. 4K is 4× the data of 1080p at the same bitrate. For most web video, 1080p or 720p is sufficient.

ResolutionUse caseNotes
4K (3840×2160)Cinematic, premium showcaseOnly if viewers have 4K displays
1080p (1920×1080)Standard web video, desktopGood default for most content
720p (1280×720)Mobile-first, social mediaHalf the data of 1080p
480p (854×480)Background video, emailFastest loading, lower quality

Bitrate: The Main Size Control

Bitrate is how much data per second the video uses. Higher bitrate = better quality and larger file. Lower bitrate = smaller file and more compression artifacts (blockiness, blurring on fast motion).

These targets work well for most web video:

Resolution + codecRecommended bitrateMB per minute
1080p H.2643–5 Mbps~23–38 MB/min
720p H.2641.5–3 Mbps~11–23 MB/min
1080p H.2652–3 Mbps~15–23 MB/min
720p H.2651–1.5 Mbps~8–11 MB/min
480p H.2640.8–1.5 Mbps~6–11 MB/min
File size formula: bitrate (Mbps) × 60 × 0.125 = MB per minute.

A 5-minute video at 4 Mbps = 4 × 60 × 0.125 = 30 MB per minute × 5 = 150 MB total.

High-motion content (sports, gaming, fast cuts) needs higher bitrates than low-motion content (talking head, screen recordings). The codec has trouble compressing fast-changing frames and needs more data to avoid artifacts.

Codec: H.264 vs H.265 vs VP9

The codec determines how efficiently video data is compressed. Newer codecs achieve the same quality at lower bitrates — which means smaller files.

  • H.264 (AVC): The safe default. Every browser, device, and player supports it. At 4 Mbps for 1080p, it delivers good quality. Use H.264 when maximum compatibility is required.
  • H.265 (HEVC): About 50% smaller files at the same quality as H.264. Supported by modern browsers and devices, but Safari's H.265 support for web video is inconsistent. Good choice if most of your audience uses Chrome or Firefox.
  • VP9 (WebM): Google's open-source codec. Similar efficiency to H.265, great browser support in Chrome/Firefox/Edge. Not supported by Safari. Best served as WebM with an MP4/H.264 fallback.
  • AV1: The newest major codec — up to 30% smaller than H.265. Browser support is excellent, but encoding is very slow on consumer hardware. Suitable for content where encoding time is not a constraint.

Compression with HandBrake (Recommended)

HandBrake is the standard free tool for video compression. It runs on Windows, Mac, and Linux.

  1. Download HandBrake from handbrake.fr and open it.
  2. Drag your video file into HandBrake or use File → Open.
  3. In the Summary tab: set Format to MP4, check Web Optimized (enables Fast Start for streaming).
  4. In the Video tab: Video Codec: H.264 (x264) for compatibility, or H.265 for smaller files.
  5. Framerate: Same as source (or 30fps if source is 60fps and you want smaller files).
  6. Quality: Use Constant Quality mode, CRF 22–23 for H.264 (lower = better quality).
  7. In the Dimensions tab: Set resolution if you want to downscale (e.g., 1920×1080 → 1280×720).
  8. Click Browse to set output path, then Start Encode.

The Web Optimized Setting (Fast Start)

Always enable Web Optimized (also called Fast Start or "moov atom first") when exporting for web. This moves the video's metadata table to the beginning of the file.

Without it: the browser must download the entire MP4 before it can start playing.

With it: playback can begin after downloading just the first few percent of the file.

This is one of the highest-impact, zero-quality-cost optimizations for web video.

HTML5 Video: Serving Multiple Formats

For optimal browser coverage, serve WebM and MP4 together using HTML5 <source> tags.

The browser picks the first format it supports:

<video controls>
  <source src="video.webm" type="video/webm">
  <source src="video.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>

Chrome, Firefox, and Edge use the WebM (smaller file). Safari and iOS use the MP4.

Result: best file size for most users, full compatibility for Apple users.

Quick Checklist Before Publishing

  • Resolution matches the use case (720p for mobile, 1080p for desktop)
  • Codec is H.264 for compatibility, H.265 for size-sensitive content
  • Bitrate is in the recommended range for the resolution and codec
  • Web Optimized / Fast Start is enabled on the MP4
  • File size is reasonable: under 30 MB/min for 1080p, under 15 MB/min for 720p
  • Watch the output on a mobile device to confirm quality is acceptable

Frequently Asked Questions

What resolution should web videos be?

1080p (1920×1080) for desktop-primary content viewed fullscreen. 720p (1280×720) for most social media, mobile-first sites, and background videos. 480p for decorative background videos or email embeds where quality matters less than load speed. Going above 1080p for web video rarely benefits viewers — most screens can't show the difference, and file sizes are much larger.

What bitrate should I use for web video?

For H.264: 3–5 Mbps for 1080p, 1.5–3 Mbps for 720p. For H.265 (HEVC): use roughly half those values for equivalent quality. High-motion content (sports, action) needs higher bitrates than talking-head or screen-recording video. Use CRF (Constant Rate Factor) mode in HandBrake: CRF 23 is a good starting point for H.264. Lower CRF = better quality, larger file.

What's the difference between H.264 and H.265 for web video?

H.265 produces about 50% smaller files at the same visual quality compared to H.264. However, H.265 requires more CPU to decode and Safari has inconsistent support for H.265 in web video. For maximum browser compatibility (including older browsers and Safari), use H.264. If your audience is primarily on Chrome/Firefox on modern hardware, H.265 saves significant bandwidth.

Should I use MP4 or WebM for web video?

Use both with HTML5 source tags: WebM (VP9) as the primary source and MP4 (H.264) as fallback. Chrome, Firefox, and Edge prefer WebM and will use the smaller VP9 file. Safari doesn't support VP9/WebM and falls back to MP4. This gives you the best combination of file size and compatibility. If you can only use one format, MP4 works everywhere.

How do I make a video load faster without reducing quality?

Enable 'Fast Start' (also called 'Web Optimized' or 'moov atom first') when exporting MP4. This moves the video metadata to the beginning of the file so the browser can start playing before the full download completes. In HandBrake, check 'Web Optimized'. Without this, viewers may have to wait for the entire file to download before playback begins.

What file size should I aim for per minute of video?

At 1080p H.264 with 4 Mbps bitrate: about 30 MB per minute. At 720p H.264 with 2 Mbps: about 15 MB per minute. At 1080p H.265 with 2.5 Mbps: about 19 MB per minute with equivalent quality to 4 Mbps H.264. The formula: bitrate in Mbps × 60 seconds × 0.125 = MB per minute. A 5-minute explainer video at good 1080p quality should be around 150 MB or less.

Does compressing a video reduce its frame rate?

Not automatically. Frame rate (fps) is separate from compression settings. 30fps is standard for web video; 24fps is cinematic. 60fps is used for sports or gaming content. Reducing frame rate from 60 to 30fps does reduce file size significantly, but also changes how the video looks. Unless you have specific reasons to keep 60fps, 30fps is fine for most web content.

What's the best tool to compress video for web?

HandBrake (free, open-source) is the most widely used desktop tool — available for Windows, Mac, and Linux. It supports H.264, H.265, and AV1 encoding with full control over bitrate and quality. For quick one-off conversions without installing software, an online converter works well for files under 1–2 GB. FFmpeg is the command-line option for automation and scripting.

How to Compress Video for the Web