Video is the fastest-growing content type on the web, but unoptimized clips can consume hundreds of megabytes and stall page loads for seconds. Proper compression, codec selection, and platform-aware encoding can shrink video files by 50-90% while preserving visual clarity. Whether you are embedding product demos, publishing social media reels, or streaming long-form content, this hub provides the tools and knowledge to deliver crisp video at a fraction of the bandwidth.
Built by Squoosh.online for fast, private video optimization.
Our browser-based video compressor lets you reduce file sizes without uploading to any server. Squoosh Video Optimize uses WebAssembly-powered encoding to transcode videos directly on your device, supporting popular input formats like MP4, MOV, and WebM. You can adjust resolution, bitrate, and codec settings while previewing the output in real time. Because everything runs locally, your footage stays completely private, making it especially suitable for confidential business presentations, client work, or personal videos you would rather not send to a third-party cloud service.
Recommended third-party platforms for advanced video editing and conversion.
Clideo is a full-featured cloud video editor that handles merging, trimming, resizing, adding subtitles, and format conversion through an intuitive drag-and-drop interface. It processes files on remote servers, which means you can work with large videos even on low-powered devices like tablets or Chromebooks. Clideo also offers preset export profiles optimized for Instagram Stories, TikTok, YouTube Shorts, and other social platforms, so you never have to guess the correct dimensions or aspect ratio.
EZGif started as an animated GIF maker and has evolved into a versatile video toolkit. It excels at converting video to GIF (and vice versa), trimming clips, adjusting playback speed, cropping, rotating, and adding text overlays. The interface is straightforward and no-frills, which makes it fast to use for quick edits. EZGif is particularly useful when you need to extract a short GIF or WebP animation from a longer video for embedding in emails, documentation, or chat platforms that do not support inline video.
A codec (coder-decoder) determines how video frames are compressed and decompressed. The codec you choose has the single biggest impact on both file size and playback compatibility.
H.264 has been the dominant web video codec for over a decade. It offers a strong balance of compression efficiency, encoding speed, and near-universal hardware decoding support on phones, tablets, laptops, smart TVs, and game consoles. Virtually every browser and media player can handle H.264 without plugins. The downside is that its compression is less efficient than newer codecs, meaning files are 30-50% larger than what H.265 or AV1 can achieve at the same visual quality. For maximum compatibility with the widest possible audience, H.264 remains the safest default.
H.265 delivers roughly 50% better compression than H.264 at the same perceptual quality, making it attractive for 4K and HDR content where file sizes would otherwise be prohibitive. Apple devices have strong HEVC support, and most modern Android phones include hardware decoders. However, web browser support is inconsistent: Safari supports it natively, but Chrome and Firefox do not due to licensing costs. This makes HEVC best suited for native mobile apps, Apple ecosystem content, and downloadable video files rather than web-embedded players.
Developed by Google as a royalty-free alternative to HEVC, VP9 achieves comparable compression efficiency (roughly 30-50% better than H.264). It is the default codec for YouTube at resolutions of 1080p and above, and it has excellent support in Chrome, Firefox, Edge, and Android devices. Safari added VP9 support via WebM in recent versions. VP9 encoding is slower than H.264 but faster than AV1, positioning it as a practical middle ground for projects that need better compression without the encoding time penalty of next-generation codecs.
AV1 is the newest royalty-free codec, developed by the Alliance for Open Media (whose members include Google, Apple, Microsoft, Netflix, and Meta). It offers approximately 30% better compression than VP9 and up to 50% better than H.264, making it the most bandwidth-efficient option available today. The trade-off is encoding speed: AV1 encoding can be 5-10 times slower than H.264, though hardware encoders in newer GPUs and chips are closing this gap rapidly. Browser support covers Chrome, Firefox, Edge, and Safari 17+. AV1 is the future-proof choice for platforms that can afford the encoding compute.
| Codec | Compression vs H.264 | Encoding Speed | Royalty-Free | Browser Support |
|---|---|---|---|---|
| H.264 | Baseline | Very fast | No (licensed) | Universal |
| H.265 | ~50% smaller | Fast | No (licensed) | Safari, some HW |
| VP9 | ~35% smaller | Moderate | Yes | Chrome, Firefox, Edge, Safari |
| AV1 | ~50% smaller | Slow (improving) | Yes | Chrome, Firefox, Edge, Safari 17+ |
A container format is the file wrapper that holds video, audio, subtitles, and metadata streams together. The container determines which codecs are supported and how the data is organized for playback and streaming.
The most universally supported container on the web. MP4 can hold H.264, H.265, and AV1 video streams alongside AAC audio. It supports streaming via progressive download and is the required format for most social media uploads. When in doubt, MP4 with H.264 video and AAC audio is the safest combination for cross-platform delivery.
Google's open container format designed specifically for the web. WebM pairs with VP8, VP9, or AV1 video and Vorbis or Opus audio. It is well supported in Chrome, Firefox, and Edge and is the default for VP9/AV1 web delivery. WebM files are often used as a secondary source in HTML5 video elements alongside an MP4 fallback.
Apple's QuickTime container is widely used in professional video production and on Apple devices. MOV supports a broad range of codecs including ProRes, which is a standard in editing workflows. While MOV plays natively on macOS and iOS, it has inconsistent support on Windows and Linux browsers. It is best used as a production intermediate and then re-muxed to MP4 for web distribution.
An older Microsoft container that lacks modern features like native streaming support and variable frame rates. AVI files tend to be much larger because they often use less efficient codecs or uncompressed streams. There is virtually no reason to use AVI for web delivery today. If you receive AVI files from legacy systems or screen recorders, convert them to MP4 before publishing online.
Each social media platform re-encodes your uploads, but starting with the right settings prevents double compression artifacts and ensures the best possible output quality. These recommendations reflect each platform's published guidelines and tested best practices.
| Platform | Resolution | Aspect Ratio | Frame Rate | Video Bitrate | Codec | Max Length |
|---|---|---|---|---|---|---|
| TikTok | 1080 x 1920 | 9:16 | 30 fps | 6-10 Mbps | H.264 | 10 min |
| Instagram Reels | 1080 x 1920 | 9:16 | 30 fps | 6-8 Mbps | H.264 | 90 sec |
| YouTube | 1920 x 1080 (or 4K) | 16:9 | 24-60 fps | 8-12 Mbps (1080p) | H.264 / VP9 | 12 hrs |
| Twitter / X | 1280 x 720 | 16:9 or 1:1 | 30-60 fps | 5-8 Mbps | H.264 | 2 min 20 sec |
| 1280 x 720 (min) | 16:9 or 9:16 | 30 fps | 6-8 Mbps | H.264 | 240 min |
All platforms accept MP4 container with AAC audio (128-256 kbps stereo). Upload the highest quality source file possible; the platform will re-encode for delivery.
Practical strategies to reduce video file sizes while keeping your content looking sharp across devices.
Two-pass encoding analyzes the entire video on the first pass to build a complexity map, then allocates bits more intelligently on the second pass. High-motion scenes get more bitrate while static frames use less, resulting in better overall quality at the same file size. Most professional tools including FFmpeg support two-pass mode, and the extra encoding time is almost always worth the quality improvement.
Not every video needs to be 4K. For talking-head content, tutorials, and screencasts, 1080p or even 720p is often indistinguishable on mobile screens. Reducing resolution from 4K to 1080p cuts the pixel count by 75%, which translates to dramatically smaller files. Reserve 4K for content where fine detail matters, such as landscape videography, product close-ups, or cinematic footage.
Audio can represent 10-20% of total file size, especially in long-form content. Use AAC at 128 kbps stereo for most web video, which is transparent quality for speech and music. If the video has no meaningful audio (background music only or silent demos), consider mono audio at 96 kbps or even stripping the audio track entirely to save space.
Every second of video adds to the file size. Cutting out long pauses, false starts, and unnecessary intros can shave 15-30% off the total duration and proportionally reduce file size. This also improves viewer retention, as audiences are more likely to watch a concise, well-paced video to completion.
CRF mode lets the encoder automatically adjust bitrate to maintain a consistent visual quality throughout the video. Lower CRF values mean higher quality and larger files. For H.264, a CRF of 23 is the default and a good starting point; values between 18 and 28 cover most use cases. CRF 18 is visually lossless for most content, while CRF 28 provides aggressive compression suitable for previews and drafts.
MP4 files store metadata (the moov atom) at the end of the file by default. This forces the browser to download the entire file before playback can begin. Moving the moov atom to the front with the -movflags +faststart flag in FFmpeg enables progressive playback, letting visitors start watching within seconds even on slower connections. This is a zero-cost optimization that every web video should have.
Dive deeper into advanced encoding techniques, FFmpeg command recipes, adaptive bitrate streaming with HLS and DASH, and real-world benchmarks comparing codecs across different content types.
Read the Full Guide