Compress Video to a Target Size
Compress a video on your device to fit a size such as 20 MB for Discord or 16 MB for WhatsApp, with a feasibility check before it starts and the real final size after.
Choose a video
or drop it here
The video is processed on this device and never uploaded.
MP4, MOV, WebM, MKV, AVI, WMV, FLV, 3GP, TS / MTS / M2TS or VOB / MPG
Files over 1 GB can be slow. Very large outputs need a browser that can save straight to a file.
How it works
The tool divides the size you want by the length of the video to get a bitrate. It sets aside room for the audio (128, 96 or 64 kbps, or none) and about 3% for the MP4 container, and the rest goes to the picture. If that is below the lowest bitrate the encoder can use (200 kbps), it tells you before anything starts and offers a trim, lower audio or no audio.
It then picks the largest resolution that still gets enough bits per pixel. Portrait videos stay portrait and nothing is upscaled. The video is encoded to H.264 on your device, with the browser's WebCodecs encoder where it has one.
When the encode finishes, the tool measures the real file. If it is over the target, it encodes the original again at a bitrate corrected by how far off it was, up to two more times, and keeps the best result. A very large output that is saved straight to a file on disk gets a single attempt, because trying again would overwrite that file.
If the video is for one person rather than an app with a size limit, you may not need to compress it at all. You can send it without uploading it anywhere with SpectrShare, another site I built. It sends the file straight from your browser to the recipient's, with no size limit and an optional password.
Supported files
- Inputs
- MP4, MOV, M4V, WebM, MKV and most files your browser or FFmpeg.wasm can read, including iPhone and Android recordings.
- Outputs
- MP4 with H.264 video and AAC audio, which plays almost everywhere, including Discord, WhatsApp and email clients.
Limitations
- Browser encoders are single-pass and can land 5 to 15% off the target. The tool re-encodes up to twice to correct this. If it is still over, it shows the real size and lets you download the best attempt.
- Very small targets for long videos look soft. Trimming usually helps more than a tiny bitrate.
- Sizes are in decimal megabytes (1 MB = 1,000,000 bytes), a little under limits counted in binary megabytes.
- Phones may be slow with files above 1 GB, and the browser may close the tab if it runs out of memory.
- Without WebCodecs the compatibility engine (FFmpeg.wasm) is used, which is much slower.
Questions
Why is the result not exactly the size I asked for?
Why did the resolution go down?
Is my video uploaded anywhere?
Is there a file size limit?
What if the target is too small?
Example
A 45-second 1080p phone clip of 85 MB, with a 10 MB target and 128 kbps audio: 10 MB is 77.6 megabits after container overhead. The audio takes 5.8 of them, leaving about 1,596 kbps for the picture, which is too thin for 1080p, so the plan uses 1280x720. If the first encode came out at 10.6 MB, the tool would re-encode the original at 1,596 x 10 / 10.6 x 0.97, about 1,460 kbps, and keep that result if it lands under 10 MB.