Video Compressor – Fit a Video Under a Size Limit Without Uploading It
This video compressor re-encodes a video on your own device so it takes less space. Open an MP4, MOV, WebM, MKV or MPEG-TS file, say how small it should be (a target file size such as 10 MB, a quality level, or an exact bitrate), and the tool chooses a resolution, frame rate and audio bitrate that fit, shows you why, and lets you preview a few seconds before you commit. Decoding and encoding run in the browser tab with the browser's own codecs, so the video is never uploaded.
File size is bitrate × duration
Every compressed video obeys one identity: size in bytes = bitrate in bits per second × seconds ÷ 8, plus about 1% for the container's index and headers. A 60-second clip that must fit in 10 MB can therefore average about 1.27 Mbps for picture and sound together. Target size mode does that arithmetic for you (aiming 4% under the limit for safety). To explore the same sums without a file, use the Video Upload File Size Estimator. Because duration is half the equation, the compressor also has a simple trim: cutting a clip in half doubles the bitrate available to every second that is left.
Bits per pixel: why resolution matters more than a quality slider
A bitrate on its own says little about quality. What matters is how many bits each pixel of each frame gets: bpp = video bitrate ÷ (width × height × fps). At 1.17 Mbps a 1080p30 video gets about 0.019 bits per pixel and looks blocky, while the same bitrate at 720p gets 0.042 and looks fine on a phone. That is why the resolution ladder in this tool shows every size side by side, coloured by expected quality, and why Auto picks the largest resolution that stays above roughly 0.04 bpp. Frame rate works the same way: a 60 fps video needs about twice the bits of 30 fps, so Auto halves high frame rates (60 → 30, 50 → 25) when the budget is tight, dropping every other frame evenly instead of introducing judder.
H.264, HEVC, VP9 and AV1 compared
H.264 (AVC) is the universal choice: every phone, browser, TV and messaging app plays it. HEVC (H.265) and VP9 reach similar quality at roughly 60% of the bitrate, and AV1 at roughly 40%, so at the same file size they look noticeably better. The catch is playback support: HEVC is at home on Apple devices but not on every Windows PC, VP9 in WebM doesn't play in iMessage, and AV1 needs recent hardware. The tool only lists formats your browser can actually encode, and its bits-per-pixel figures are scaled to H.264 so the quality zones mean the same thing for every codec.
CBR, VBR, CRF and two-pass encoding
Desktop encoders offer several rate-control modes. Constant bitrate (CBR) spends the same bits every second; variable bitrate (VBR) lets busy scenes borrow from quiet ones; constant quality (CRF) fixes the quality and lets the size fall where it may; and two-pass encoding analyses the whole video first so it can hit a size almost exactly. Browsers expose only one-pass encoding through WebCodecs, often on a hardware encoder that varies between devices, so the real bitrate drifts from the request. This compressor handles that by measuring the finished file and, if it is over the target, re-encoding with a corrected bitrate (up to three attempts in total). Quality mode uses the browser's constant-quality encoding where available, which is why its size can only be estimated from a sample.
Hardware and software encoders
Browsers hand encoding to the graphics chip when they can. Hardware encoders are fast and light on the battery but less efficient at low bitrates, and some refuse unusual frame sizes. Software encoders are slower but more predictable. If an export fails part-way, the tool offers to try again with software encoding.
HDR, audio and metadata
Re-encoding in a browser usually converts HDR footage (such as iPhone Dolby Vision clips) to standard dynamic range, so colours can look different from the original. Audio is copied untouched when it is already small enough, otherwise re-encoded as AAC or Opus at a rate that leaves most of the budget for the picture; you can also remove it or switch to mono. Location tags written by phones are removed by default.
Email attachments and base64
Email sends attachments as base64 text, which is about 33% larger than the file itself, so a provider's attachment limit may leave room for a smaller video than the headline figure suggests. How each provider counts this isn't something this tool has verified, so leave a generous margin, or share a link instead of attaching.
Credits
Reading, decoding, encoding and writing video files is done by Mediabunny, an open-source media toolkit for the web released under the Mozilla Public License 2.0, on top of the browser's WebCodecs API. For a lossless cut without re-encoding, use the Video Trimmer.