# Video Compressor

> Bring videos down to a specific file size, for example for WhatsApp, email or Discord. No upload, no watermark.

- Open in browser: https://pockettoolbox.org/en/video-compressor
- Runs entirely in your browser; files and input are never uploaded.

## How it works

Re-encodes videos with your device's video encoders and hits a chosen file size.

Enter how big the file may be at most. The tool works out the right bitrate from length and target size and picks a resolution that keeps the picture intact. You can also set quality and resolution yourself. The result is an MP4 file with H.264 and AAC that plays on practically any device. If the target is narrowly missed, a second pass starts automatically.

Demuxing, decoding and encoding via WebCodecs with mediabunny, usually hardware accelerated. Target bitrate = (target size × 8 × 0.96 − audio bits) ÷ duration. The resolution is chosen so that at least 0.07 bits per pixel per frame remain. Firefox gets an AAC encoder compiled to WebAssembly. Output is MP4 with fast start (moov first) so it starts playing right away when streamed.

## FAQ

### Why does it take a while for long videos?

Every frame is encoded again. With a hardware encoder a current laptop usually runs several times faster than real time, so a ten-minute phone video is done in one to three minutes. Older devices take longer.

### Can I compress an iPhone video (MOV, HEVC)?

Yes, if your browser can read HEVC. Safari on Mac and iPhone always can, Chrome and Edge on Windows usually as well. You get an MP4 with H.264 that also plays on Android and Windows.

## Popular tasks

- [Compress a Video](https://pockettoolbox.org/en/compress-video)

---
PocketToolbox (https://pockettoolbox.org/en)
