Compress a video to an exact size

Runs on your device · Your file never leaves your device.

Set the size you need and the video is encoded to fit it. This is the tool for an attachment cap, a messaging limit, or a form that refuses anything over 25 MB.

The bitrate the target allows is calculated from the video’s duration, then the result is measured and corrected if it overshoots — so you get a file that actually fits rather than one that is merely smaller.

Lowering the resolution as well as the bitrate produces a far better-looking result at small targets: a 720p video at 8 MB looks much better than the same clip kept at 1080p and starved of bitrate.

How to compress a video to an exact size

  1. Add the video that is too big to send.
  2. Choose one of the three sizes suggested for your video, or type your own.
  3. Press Compress — resolution and bitrate are traded off to reach the target.
  4. Download the smaller file and check it still looks acceptable.

Supported formats and limits

Input
MP4, MOV, MKV, AVI, WebM and more
Output
Smaller MP4
Controls
Target size, with three sizes suggested for your video
Trade-off
Lower bitrate, and lower resolution where needed
Where it runs
In your browser; nothing uploaded

Not for: Squeezing a very long recording into a very small size — length decides how much picture fits in the megabytes; trim it first with the Trim tool.

Where the three suggested sizes come from

When one video is chosen, three targets are suggested from its length, frame size, frame rate and sound. Each assumes an amount of data per pixel of picture: 0.10 bits for Nothing you can see, 0.05 for Fine for anyone, and 0.03 for Smallest that still plays, which is also brought down to 360p. For a 3-minute 1080p clip at 30 frames per second with sound, that gives 148 MB, 76 MB and 8 MB. A suggestion that would not be smaller than the file itself is marked as already this small.

How a target is spent

3% of the target is set aside for the container. The sound gets 128 kbit/s when the target allows at least 600 kbit/s in all, less below that, down to 48; it is always encoded again as AAC. The rest goes to the picture, but never more than the original picture had. If that is too little for the frame to stay watchable, the frame steps down one standard height at a time, as far as 240 lines. For the clip above, 25 MB becomes 720p with about 950 kbit/s of picture. When even 240p would get less than 40 kbit/s, the tool refuses and names the smallest size that is still watchable.

A video already under the target is not encoded again when it is H.264, HEVC or AV1 with AAC or MP3 sound: its streams are only re-packaged as MP4.

How the size is hit

Your device's video encoder is tried first. Its rate control tends to overshoot, so the first pass aims 5% under the calculated bitrate, and the finished file is measured. If it is over the target, the bitrate is cut in proportion, with another 5% margin, and encoded again. If it fits but uses less than 85% of the target, the bitrate is raised by up to 60% so the spare room goes to the picture. After at most three passes the largest file that fits is kept; if none fits, you get the smallest and a note saying so.

The engine runs the same loop with x264 when the device encoder cannot do the job, or when the target is over 1.5 GB, or 400 MB on a device that reports 4 GB of memory or less. On the engine, an input over 1 GB is encoded in parts, each with its exact share of the bytes and no second pass; the target then covers all the parts together.

Measured on a 4-core computer with no graphics chip, a 3-minute 1080p film compressed to 25 MB took 91 seconds on the device encoder and 653 seconds on the engine.

Frequently asked questions

Are my files uploaded to a server?
No. This conversion runs inside your browser using your own device’s processing power, and the file is not uploaded. Once a tool has been used once (video, text recognition and background removal download their engine from this site the first time), it keeps working when your connection drops.
How small can a video go?
Length is what dominates. A 30-second clip compresses to a few megabytes easily; an hour-long recording at the same size would be unwatchable. Shorten or trim it if the target is very small.
How long does it take?
It depends on the device. Your device’s own video encoder does the work where the browser offers one, and the engine built into the page does it otherwise; on a 4-core computer without a graphics chip, a 3-minute 1080p film compressed to 25 MB took 91 seconds on the first and 653 on the second. Progress is shown throughout, and the note under the result says how long the device encoder took.

Other sizes and destinations

Related tools

More in Video

This page in other languages: العربية · Deutsch · Français · Español · Русский · Português · 中文 · हिन्दी · Türkçe · עברית · فارسی · اردو · Bahasa Indonesia · বাংলা