Skip to main content

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.

Target size

1 MB = 1,000,000 bytes, so the file fits limits counted either way.

Audio

A lower audio bitrate leaves more of the size for the picture. 96 kbps is fine for speech.

Trim (optional)

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?

Video encoders aim for an average bitrate, and how many bits a scene needs depends on its content. The tool measures each result, re-encodes when it is over, and keeps the closest result under the target.

Why did the resolution go down?

At a low bitrate a smaller picture looks sharper than a large, blocky one. The tool lowers the resolution only when the bitrate would be spread too thin.

Is my video uploaded anywhere?

No. Compression runs in your browser and the file never leaves your device. The page downloads its engine files once and records anonymous usage events, never the video.

Is there a file size limit?

There is no fixed limit on the input. A result of up to 512 MB is kept in memory for download. A larger result needs the save-to-file picker in desktop Chrome or Edge, which writes it straight to disk; other browsers, including phones, cannot make it. Phones may be slow or run out of memory with inputs above 1 GB.

What if the target is too small?

The tool says so before it starts and shows how much video fits, and whether lower-bitrate audio or no audio would make it reachable.

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.