Compress Video to Target Size
Aim for a target size in MB with a single-pass MP4 encode. The result may exceed the target; check its size before uploading. The bitrate is worked out from the clip's length, and the file never leaves your device.
How to use
- Choose one video: Drop a video onto the box or click to pick it. One file at a time, up to 50 MB, in MP4, MOV, MKV, WebM or AVI. On a supported browser the processing core starts downloading in the background right away, so part of the first-run wait happens while you fill in the next step.
- Type the target size: Put the number the platform asks for in the Target file size box, or use one of the Common targets buttons: 8, 10, 16, 25 or 50 MB. The number counts as MB of 1 000 000 bytes.
- Decide about the sound: Keep the sound leaves an AAC audio track at 128 kbps. Clear it to drop the audio and give the whole target to the picture, which matters most on short clips and small targets.
- Compress and save: Click Compress to 25 MB (the button repeats whatever target you typed). The line above the result shows the size before and after; play the preview, then download the MP4 or send it to your share sheet.
How to compress video to target size
total kbps = target bytes x 8 / 1000 / duration in seconds video kbps = (total kbps - audio kbps) x 0.93 Local ffmpeg 9.0.2 test, not a browser test 26 714-byte clip, 160x120, 2.000 s target | sound | result 0.1 MB | kept | 59 080 bytes 0.1 MB | off | 35 017 bytes 0.2 MB | kept | 68 506 bytes
Compress one video up to 50 MB toward a chosen size in MB, entirely in your browser. Output is H.264 MP4, with a 7% video-bitrate margin; the final size must still be checked. Nothing about the bitrate is guessed: the video's duration is read first, then the target size is divided by that duration to get the bitrate the whole file is allowed to use. The audio is subtracted from it (128 kbps when the sound is kept, nothing when it isn't), about 7% is held back as a margin, and whatever is left becomes the picture's bitrate. That margin absorbs container overhead and the way an encoder's output wobbles from one scene to the next — which is why the result usually comes in under the target, though nothing in the encode enforces that.
The compression itself is a single H.264 pass at that average bitrate, with the peak capped at 1.45 times the average so one busy shot can't blow the budget. One pass is the sensible choice inside a browser — a second pass would mean holding the whole intermediate file in memory — and the price is precision: there is no second attempt if the first one overshoots, so the finished size is the number to go by, not the one you typed. It can also land well under. In a local ffmpeg 9.0.2 test, not a browser test, a 2-second 160x120 clip aimed at 100 000 bytes came out at 59 080 bytes, 59% of the target, because x264 cannot spend that much bitrate on a frame that small. Footage with more detail in it generally has more to spend that budget on, so it tends to use more of the target; how much more depends on the clip, and we have no measurement to quote for ordinary phone video.
One MB counts as 1 000 000 bytes here, not 1 048 576. That is normally what a platform means by "25MB", and it is the stricter of the two readings — anything that fits 25 000 000 bytes also fits 25 MiB, so a target met here is met everywhere. The one side effect is cosmetic: the finished size is displayed in 1024-based MB, so it always reads slightly under the number you typed.
Which target should you type?
Type the number the platform itself shows you, not a number from a how-to article. Email services, chat apps, course platforms and job portals all cap uploads differently, and they revise those caps — Discord changed its free upload limit during 2026, for one — so a figure from an old guide is the least reliable input you can give this tool. Gmail's own help pages still put personal attachments at 25 MB, which is why 25 is what the box starts with.
The Common targets buttons — 8, 10, 16, 25 and 50 MB — are simply the numbers that come up most often: single-digit caps on community and chat apps, 16 MB for media messages, 25 MB for an email attachment, and 50 MB for a file that only just went over a 50 MB limit. Anything else goes in the box; the buttons are shortcuts, not the only choices.
A target that is too small is refused rather than turned into a mosaic. If the arithmetic leaves the picture less than 80 kbps — a tiny target, a long clip, or audio eating most of the budget — nothing is encoded at all and the tool asks you to set a larger target, turn the sound off, or shorten the clip first. Clearing Keep the sound is usually the cheapest of the three: in the 0.1 MB test above, dropping the audio moved the picture's allowance from 253 kbps to 372 kbps, a 47% increase, because the entire target then belongs to the video.
A target larger than the file you brought makes the file bigger, not smaller. The bitrate is derived from the target either way, so aiming a 2 MB clip at 25 MB just re-encodes it at a far higher bitrate than it had — all three local test runs came out larger than the 26.7 KB source file, the worst of them 2.6 times larger. When the video you pick is already under the target, the page says so before you press the button; the fix is to type a number below its current size, or to leave the file alone.
Need to do the same thing to a photo for the same upload form? Compress Image to Size takes a target in KB or MB and works the same way.
What the compressed MP4 keeps — and what it drops
The resolution is left exactly as it was. The only thing the scaling filter does is round the width and height to even numbers, which H.264 requires — there are no 1080p or 720p steps on this page, so a 4K clip stays 4K at a lower bitrate. That has a consequence worth knowing before you type a small number: bitrate is the only lever being pulled, so at a very small target the picture goes soft instead of smaller in frame.
Kept in the result: the first video track's picture, the original resolution, the orientation (a portrait clip stays portrait), and the date and time the video was filmed. That timestamp is written back deliberately — ffmpeg does not normally carry it across — so the file still sorts correctly if you save it back into a photo library. Track-level titles, languages and chapter marks are left alone.
Dropped from the result: GPS coordinates, device make and model, software names and the rest of the global metadata, so a holiday clip stops carrying the place it was filmed. Subtitle and data tracks are not written in. HDR and 10-bit video is flattened to 8-bit SDR, because the output pixel format is fixed. When the source has an audio track and Keep the sound is selected, that audio is re-encoded to AAC at 128 kbps even if it was already AAC, and there is no 64 or 96 kbps setting; clear the box, or bring a video with no sound in it, and the result has no audio track at all. The container and codec are always MP4 and H.264, so MOV, MKV, WebM and AVI files all come out as .mp4 — this is a re-encode, not a lossless change of wrapper.
The playback index is written at the front of the finished file, so the result can start playing while it is still downloading from a web page or a cloud drive instead of only after the last byte arrives.
Limits, and when this is the wrong tool
One video at a time, up to 50 MB, and it has to be a video: anything else you drop on the box is skipped with a note saying why, audio files included. There is no separate limit on how long the clip can be — the real constraints are that 50 MB and how much memory your phone or laptop can spare for the encode.
All of it happens on your device. The ffmpeg.wasm engine is downloaded with the page and encodes locally, and this particular path has no server behind it at all, so a file your browser cannot manage reports an error rather than being quietly uploaded somewhere. The cost is a cold start: the first run on a device fetches about 31 MB of processing core, which begins the moment you choose a file so that part of the wait overlaps with typing the target. How long the encode then takes depends on the device, the clip and how busy the picture is; the page shows a percentage rather than an estimate, and we have no browser timings to quote.
Re-encoding needs multi-threaded processing, which needs SharedArrayBuffer, so this page is served cross-origin isolated. The latest Chrome, Edge and Firefox provide that; private windows and some in-app browsers switch it off, and when they do the page says so on the first click instead of after you have downloaded 31 MB of core. If an encode goes 75 seconds without any sign of life the worker is stopped and you get an error, so the progress bar cannot spin forever, and the Cancel button beside it returns you to the form with nothing reported as a failure.
This page exists for files that are over a cap, and only for that. It cannot hit a byte-exact size, change the resolution, trim a clip, process several videos at once, set the audio bitrate, convert to H.265, keep the original container, or compress without loss. If the real problem is that the picture needs to be clearer at a small size, lower the resolution first with a tool built for that, then bring the smaller file back here.
Frequently asked questions
- How do I compress a video to 25 MB for email?
- Set the target to 25 MB or slightly less, then check the encoded file against your email service's current limit. The size can't be exact and isn't guaranteed to be under the target: a single-pass encode lands near the number, about 7% is held back as a margin, and a busy picture can still push the result over — the result line says so when it happens, and a smaller target or dropping the sound is the fix. It can also finish well under, as in the local test where a 2-second clip aimed at 100 000 bytes came out at 59 080 bytes.
- Does 25 MB here mean 25 000 000 bytes or 25 MiB?
- 25 000 000 bytes. One MB counts as 1 000 000 bytes, which is usually what a platform means by its limit and is the stricter of the two readings, so a file that fits here also fits a 25 MiB cap. Because sizes are displayed in 1024-based MB, the result reads a little below the number you typed.
- What happens if my video is already smaller than the target?
- It would be re-encoded larger, so don't do it. The bitrate is calculated from the target whatever the source size is, so a target above the current size means a higher bitrate than the file had. The page warns you as soon as it spots this; set a target below the file's current size, or keep the original.
- Why was my target rejected as too small?
- Because the arithmetic left the picture under 80 kbps, and nothing is encoded at that point rather than handing you a mosaic. Raise the target, clear Keep the sound to give the audio's 128 kbps to the picture, or shorten the clip — a shorter video has fewer seconds to spread the same number of bytes over.
- Can I pick 720p or 1080p while compressing?
- No. This page only changes the bitrate; the resolution stays exactly as it was, apart from rounding the width and height to even numbers. If a small target leaves the picture too soft, reduce the resolution with a separate tool first and then compress the smaller file to your target here.
- Is my video uploaded anywhere?
- No. The encoder runs inside your browser, the file is read straight from your device, and this tool has no server fallback — if your browser can't finish the job it reports an error rather than sending the video off. Close the tab and nothing is left behind.
- Does it keep the location and date the video was filmed?
- The date and time are kept; the location is not. GPS coordinates, device make and model and other global metadata are stripped, which is what you want before posting a clip publicly. The capture timestamp is written back on purpose so the file still sorts by date in a photo library.
- Which browsers does this work in?
- Any up-to-date Chrome, Edge or Firefox. Re-encoding needs multi-threaded processing, so the page has to be able to use SharedArrayBuffer; private windows and some in-app browsers disable it. When that is the case, the page tells you on the first click, before downloading the 31 MB processing core.