Back to blog
compressionwebguide January 10, 2025

How to compress video for the web

Learn how to reduce video file size for the web without sacrificing quality. Covers bitrate, resolution scaling, codec choice, and browser-based tools.

Video files are large. A raw 10-minute 1080p recording can easily be 4–8GB. For web use — embedding on a site, sharing via email, or uploading to a platform — you need that much smaller. This guide explains how.

Why videos are so large

Uncompressed video is just a sequence of images. At 30 frames per second, a single minute of 1080p video would be around 90,000 raw images. Even at a modest 2MB per frame, that’s 180GB per minute.

Modern video files use codecs — algorithms that compress video by predicting what changes between frames and only storing the differences. H.264, the most common codec, reduces that 180GB/minute figure to around 1–3GB/minute for high quality, or much less for web delivery.

The key variables

Codec choice

CodecContainerCompressionCompatibility
H.264MP4, MKV, MOVGoodUniversal
H.265 (HEVC)MP4, MKVExcellentWide (not all browsers)
VP9WebMVery goodModern browsers
AV1WebM, MP4BestNewest browsers only

For web use, H.264 in an MP4 container is the safest choice. Every browser, phone, and platform supports it.

CRF (Constant Rate Factor)

CRF is the main quality lever in H.264 encoding. Lower = better quality + larger file. Higher = smaller file + lower quality.

  • CRF 18: Near-lossless. Hard to distinguish from the original.
  • CRF 23: The default. Good quality for most content.
  • CRF 28: Noticeably lower quality, but significantly smaller files.

For most web video, CRF 23–26 is a reasonable range.

Resolution

If your video is 4K and you are serving it at 720p on a webpage, encode it at 720p. Resolution is one of the biggest drivers of file size.

A 4K → 720p downscale can reduce file size by 80% even at the same CRF value.

Audio bitrate

For most web video, 128kbps AAC is indistinguishable from the source. Dropping from a 320kbps source saves meaningful space on longer videos.

Browser-based vs server-side compression

Traditionally, video compression required installing FFmpeg locally or uploading to a service. Browser-based tools like smaller.video run FFmpeg compiled to WebAssembly directly in your browser — no installation, no uploads, and your file never leaves your device.

The tradeoff is speed: WebAssembly is close to native but not quite. For most files up to a few GB, it’s practical.

Practical settings for common use cases

Sharing via email or messaging: MP4, CRF 26, 720p

Embedding on a website: WebM (VP9) or MP4 (H.264), CRF 24, at display resolution

Uploading to YouTube or social platforms: MP4 H.264, CRF 18–20, original resolution (platforms re-encode anyway; give them quality to work with)

Archiving: MKV, CRF 20, original resolution


Drop your file into smaller.video, choose your settings, and download the result. No installation required.

Ready to compress your video?

Try smaller.video — it's free