2026-10-01 · 7 min read
How to compress a video to an exact file size
Most video tools offer a quality slider and wish you luck. But upload limits are not qualities; they are numbers. “Under 20 MB” is a spec, and hitting a spec takes arithmetic, not vibes. Here is the arithmetic, exactly as SqueezeVid runs it.
Size is bitrate × duration
A video file is essentially a stream of bits flowing at some rate for some time, so its size is simply bitrate multiplied by duration. A 20 MB target for a 60-second clip means the whole file may flow at about 2.8 Mbit/s. That single division is the heart of every size-targeted encode.
It also explains the harsh truth about long videos: the same 20 MB across 20 minutes is only ~140 kbit/s, not enough for watchable 1080p, no matter how clever the encoder. Duration, not the tool, decides what a target can look like.
Subtract before you spend
The video track does not get the whole budget. The container (MP4 boxes, sample tables) costs real bytes, and the audio track flows at its own rate: a typical 128 kbit/s AAC track eats about 1 MB per minute, which at small targets is serious money.
So the planner works like an accountant: take the target, hold back ~7% for container overhead and encoder imprecision, subtract the audio (kept as-is when it is cheap, re-encoded at 96 or 64 kbit/s when it is not, with the option to drop it entirely), and hand the video encoder what remains. If what remains is below the floor where H.264 produces anything watchable, SqueezeVid refuses with an honest message instead of delivering sludge.
The resolution ladder
Encoders have a thin red line measured in bits per pixel per frame. Give 1080p60 only 500 kbit/s (about 0.004 bits per pixel) and you get smearing and blocking. The fix is counterintuitive but reliable: shrink the picture. The same 500 kbit/s at 540p carries four times the bits per pixel, and a sharp 540p beats a mushy 1080p on every screen.
SqueezeVid automates the trade with a ladder (2160, 1440, 1080, 720, 540, 480, 360, 240), stepping down until the budget per pixel crosses a sanity threshold (and capping frame rate at 60, or 30 in emergencies). The result panel tells you which rung it chose and why.
Trust, but verify
Encoders treat a requested bitrate as a strong suggestion, not a contract: real output lands a few percent off in either direction. For a hard limit, “a few percent over” means rejection. So after encoding, SqueezeVid weighs the actual file. Under the limit: done. Over: it re-encodes with the bitrate scaled down by the overshoot, which in practice settles the matter in one retry.
That verification step is the difference between “compressed near 20 MB” and a download button that only ever hands you a file that actually fits.
One trap: email limits lie
Gmail says 25 MB, and will reject your 20 MB attachment anyway. Email encodes attachments in base64 (4 characters per 3 bytes, a 33% markup) and the limit applies after encoding. The real ceiling for the file is roughly limit ÷ 1.37. That is why SqueezeVid’s Email preset targets 18 MB, not 25.
Try it on a real file
SqueezeVid compresses any video to an exact size, in your browser, free. No upload, no watermark, no account.
Open the compressor