Video Compressor
Make a video fit an upload or email limit by typing a size in MB, or pick a CRF quality level. Shows the size before and after; files stay in your browser.
The interactive tool loads here when JavaScript runs.
About this toolWhat is Video Compressor?
The compressor has two modes. In Target file size you type the number of megabytes you need to stay under (or tap 8, 10, 25, 50 or 100 MB) and the tool works out the video bitrate that fits that size over the length of your clip. In Quality (CRF) you choose how good the picture should look and let the size fall where it may.
Both modes write H.264 video and AAC audio in an MP4, the combination every phone, browser and chat app plays. You can also lower the resolution, trim the audio bitrate or drop the sound entirely, which often matters more than the video settings for short clips. Each file shows its size before and after and the percentage saved.
ffmpeg runs inside your browser as WebAssembly. The engine is downloaded once (about 32 MB from the jsDelivr CDN), and the videos you compress are never uploaded.
- Target size mode with automatic bitrate maths and a corrective second attempt
- CRF quality mode from 18 to 35
- Optional downscale to 1080p, 720p, 540p, 480p or 360p
- Audio at 128, 96 or 64 kbps, or removed
- Before and after sizes with percentage saved
- H.264/AAC MP4 output that plays everywhere, made locally in your browser
How to use Video Compressor
- Drop one or more videos, or record the 3-second sample (which sets a small target so you can see the effect).
- Choose Target file size and type the limit in MB, or choose Quality (CRF) and move the slider.
- Optionally pick a lower resolution, a smaller audio bitrate or Remove audio, and choose Faster or Smaller encoding.
- Click Compress. In size mode, the row shows the planned bitrate and, if needed, a second corrected attempt.
- Compare before and after sizes, preview the MP4 and download it.
Worked examples
Screen recording for a 25 MB email limit
Input
3-minute 1080p recording, 180 MB, target 25 MB, audio AAC 96 kbps
Output
Video at about 950 kbps; MP4 of roughly 23 to 24 MB
25 x 8000 x 0.94 / 180 = 1,044 kbps in total, minus 96 kbps for audio. Text in screen recordings survives this well because most of the frame is static.
Phone video at a fixed quality
Input
45 s 4K phone clip, CRF 26, resolution 1080p, Smaller encoding
Output
Typically a tenth or less of the original size
Phones record at high bitrates so that fast motion never breaks up; re-encoding at a sensible CRF and 1080p removes most of that headroom.
Background and insight
File size is bitrate multiplied by duration. A 2-minute clip that must fit in 25 MB has 25,000,000 x 8 / 120 = about 1,667 kbps to share between picture and sound. The tool keeps 6% back for MP4 overhead and rate-control wobble, subtracts the audio bitrate you chose and gives the rest to the video. It counts 1 MB as 1,000,000 bytes, slightly less than the 1,048,576-byte MiB some apps use, so either way the result fits.
Hitting a size exactly is normally a job for two-pass encoding: one pass to analyse the video, a second to spend bits where they help. In a single-threaded browser that doubles an already slow job, so this tool uses one pass with a capped bitrate and checks the result. If the file came out over the target, it runs once more with the bitrate lowered by the measured overshoot plus a 3% margin.
CRF (constant rate factor) is x264's quality dial. 0 is lossless, 23 is the default, and 51 is the worst. As a rule of thumb from the x264 documentation, every 6 points roughly halves or doubles the size. 18 to 20 looks close to the source, 23 to 26 is a good everyday setting, and above 30 softening becomes obvious.
Common use cases
Chat and upload limits
Get a clip under the attachment limit of a chat app, forum, ticketing system or form upload.
Email attachments
Squeeze a demo or bug repro under a mail provider's attachment cap, such as Gmail's 25 MB.
Saving phone storage
Re-encode high-bitrate phone and action-camera footage to a quality level you are happy to keep.
Faster page loads
Shrink a background or product video before adding it to a website or documentation page.
Tips and limitations
- For very small targets, lower the resolution too. A 1080p picture at 300 kbps looks worse than a 480p picture at the same bitrate.
- Audio is a fixed cost: 128 kbps stereo AAC is about 1 MB per minute. For speech, 64 kbps is enough; for silent screen recordings, remove it.
- If the result is not smaller than the source, the original was already efficiently encoded. Use a lower target or a higher CRF.
- Smaller (x264 medium) gives about 5 to 10% smaller files at the same quality but takes roughly three times as long as Faster.
- Very long or 4K videos are slow in the browser and limited to about 1.9 GB; HandBrake or desktop ffmpeg will be much quicker.
Frequently asked questions
How does the compressor hit a target file size?
It divides the target size by the video duration to get a total bitrate, keeps 6% back for overhead, subtracts the audio bitrate and encodes the video at the rest with a capped rate. If the output is still over, it runs a second attempt at a corrected bitrate.
What CRF value should I use to compress a video?
Start at 23 to 26. Around 18 to 20 is visually close to the source, and above 30 the picture gets noticeably soft. Each increase of about 6 roughly halves the file size, so moving from 23 to 29 is a large saving with a visible cost.
Why did my compressed video come out bigger than the original?
The source was already encoded efficiently, often at a lower bitrate than the setting you chose. Re-encoding cannot beat that without lowering quality. Choose a smaller target, a higher CRF or a lower resolution, or keep the original.
Is two-pass encoding used for the target size mode?
No. Two passes would double the time in a single-threaded browser engine. The tool uses one pass with a bitrate cap and checks the result; when a short or busy clip overshoots, it automatically re-encodes once with a corrected bitrate.
Does the video compressor upload my files?
No. Only the ffmpeg engine is downloaded, from the jsDelivr CDN. Your video is read into the engine in this browser tab and the compressed MP4 is created in memory and saved with an ordinary download.
Why is the output always MP4 with H.264?
Because the point of compressing is usually to share, and H.264 with AAC in MP4 plays on every phone, browser and chat app. HEVC or AV1 would be smaller but many players cannot open them. Use the Video Converter if you need another container.
Is there an in-depth guide to Video Compressor?
Yes. “Video Formats Explained: Containers, Codecs, Bitrate and CRF” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.