How it works
Compression that happens on your device
A plain-English walkthrough of how Compress Video File turns a big video into a small one — entirely inside your browser, without ever uploading your file.
The flow, in three steps
- 1
You drop a video in
When you pick or drag a file, your browser reads it straight from disk into memory. We read its metadata — dimensions, duration, size — with a quick hidden
- 2
You choose a target size
Pick a preset (WhatsApp 16 MB, Email 25 MB, Discord, Discord Nitro 500 MB…) or set a custom size and resolution. We convert that into a precise video bitrate the encoder should aim for.
- 3
It compresses, locally
A WebAssembly build of ffmpeg re-encodes the video to H.264/AAC at that bitrate, showing a real progress bar. When it's done, you preview and download. The original and the result both stay in your browser's memory.
The engine: ffmpeg, compiled to WebAssembly
ffmpeg is the industry-standard video tool that powers most of the encoders you've ever used. Normally it runs on a server. We use ffmpeg.wasm — the same ffmpeg compiled to WebAssembly so it runs inside your browser tab. That's the unlock: a real, full-strength video encoder with no server.
The first time you compress something, the browser downloads the compressor's code (a one-time ~25 MB WebAssembly binary) from a CDN and caches it. To be clear about what crosses the network: the code comes down; your video never goes up. After that first load it's cached, so repeat compressions — and even offline use — work without touching the network at all.
Where your browser supports it, we load the multithreaded build of the encoder (using all your CPU cores for speed). That needs a browser feature called SharedArrayBuffer, which is why this site sends special cross-origin-isolation headers. If those aren't available, we automatically fall back to the single-threaded build — slower, but it still works everywhere.
The math behind hitting a target size
A video file's size is basically its bitrate (bits per second) multiplied by its duration. So to hit a target size, we work backwards from how many seconds long your clip is:
total_kbps = (target_MB × 8192) ÷ duration_sec
video_kbps = max(total_kbps − 128, floor)
We reserve 128 kbps for AAC audio and give the rest to the video stream,
clamped to a sensible minimum so the result never turns to mush. If your
target is implausibly small for a long clip, the app warns you before
encoding instead of producing an unwatchable file. Then ffmpeg encodes
with H.264 (libx264),
a matching -maxrate/-bufsize,
optional downscaling, and -movflags +faststart
so the file streams instantly.
Audio works the same way
The same engine handles audio. Switch to the Audio tab and you can drop in an MP3, M4A, AAC, WAV, FLAC, OGG or Opus file — including WhatsApp voice notes — and shrink it without it ever leaving your device.
The one difference is what you aim at. Video targets a file size, because that's the constraint you actually run into (“it has to fit in 16 MB”). Audio targets a bitrate instead, because that's the native mental model for sound: 192 or 128 kbps for music, 64 kbps for speech. Size then follows predictably from the length of the file. Output is MP3, which plays everywhere, or M4A/AAC, which is smaller at the same quality.
Trimming, and why it's free of quality loss
Compressing a video means decoding every frame and re-encoding it at a lower bitrate. That's real work, and it costs a little quality. Trimming doesn't have to do either.
A video file is a container holding already-encoded streams. To cut between two points, you can simply copy those streams into a new container and leave the encoded data untouched. Nothing is decoded, nothing is re-encoded — which is why the trim tool's fast mode finishes a large clip in about a second and returns a file that is bit-for-bit as good as the original.
There's one honest catch. Compressed video only stores complete pictures every few seconds — those are keyframes; every frame in between is stored as a difference from the one before it. A stream copy therefore has to begin at a keyframe, because starting anywhere else would leave the first frames with nothing to be different from. If your start time lands between two keyframes, the cut begins at the earlier one and you get a slightly longer clip. We tell you when that happens rather than quietly handing you something you didn't ask for.
When the cut has to be exact, Precise mode re-encodes the video so it starts on the exact frame you chose. It's slower and technically lossy, like any re-encode — a genuine trade, which is why it's a choice rather than a default. Audio always uses the lossless path: audio frames are short enough that a stream copy is effectively sample-accurate, so there's no trade to make.
You can also trim while compressing. The compressor has an optional Trim panel — useful when a long clip won't fit a size limit, since cutting it down means the remaining footage gets a much larger share of the bitrate.
Why “never uploads” is true, not marketing
Most online video compressors upload your file to a server, compress it there, and hand back a download. Your personal video then sits on a machine you don't control. Compress Video File is built the opposite way: the encoder runs in your browser, so there is no upload step at all. The only network request is for the encoder's own code — and you can verify that in your browser's Network tab: you'll see the wasm download, and you'll never see your video go out.
See it for yourself
Drop in a clip and watch the progress bar move — no upload, no waiting on a server queue.