# Compress Image to Size: 20 KB to 2 MB, Video Too

- [Home](/)
- -
- [Tools](/tools/)
- -
- Compress Image or Video to Size

# Compress an Image to a Size Limit, Videos Too

Upload forms reject a photo for being a few kilobytes too big. Pick the limit, from 20 KB to 2 MB or any size you type, and get the best-looking image that fits under it, right in your browser. Videos that need to fit a limit up to 100 MB work too.

Maximum file sizeUnder 20 KBUnder 50 KBUnder 100 KBUnder 200 KBUnder 500 KBUnder 1 MBUnder 2 MBUnder 8 MBUnder 10 MBUnder 16 MBUnder 25 MB (email)Under 50 MBUnder 100 MBCustom size...Save images asJPG (accepted almost everywhere)WebP (smaller, keeps transparency)Image dimensionsKeep, shrink only if needed to fitLimit width / heightExact size (e.g. 600x600)

Drop images or videos to fit under 100 KB, or click to choose

JPEG - PNG - WebP - AVIF - HEIC - BMP - GIF up to 100 MB - MP4 - MOV - WebM - MKV videos up to 2 GB (500 MB on phones)

Choose files

How it works: the tool searches for the highest quality that fits and keeps that version. If even low quality is too big, it reduces the dimensions step by step and tries again. Sizes count 1 KB as 1,000 bytes, slightly stricter than 1,024, so the file fits either way. The new file carries no EXIF data (no location or camera details).

Videos: the tool works out the bitrate the limit allows from the video&#x27;s length, lowers the resolution to 1080p, 720p or 480p if that bitrate would look blocky, and saves an H.264 MP4. AAC audio is kept as is when it fits; otherwise it&#x27;s re-encoded to AAC at 64 to 96 kbps. If the file comes out over, it tries up to twice more at a lower bitrate, and never offers a file over the limit.

[HEIC decoding by libheif (LGPL-3.0)](https://github.com/strukturag/libheif)

AAC encoding (in browsers without a built-in AAC encoder) by [FFmpeg&#x27;s libavcodec](https://ffmpeg.org/) ([LGPL-2.1-or-later](https://ffmpeg.org/legal.html)), loaded as a separate file only when needed.

Common limits: [compress to 20 KB](/tools/compress-image-to-20kb/), [50 KB](/tools/compress-image-to-50kb/) or [100 KB](/tools/compress-image-to-100kb/).

Free to UseNo hidden chargesNo Software InstallationRuns in your browserNo Sign UpStart instantly

## Made a small copy to share? Keep the original

The compressed file is for the upload box or the chat. Keep the full-quality original in DragBin, encrypted on your device before it&#x27;s uploaded. DragBin protects files with [client side](/client-side-encryption/), [quantum resistant encryption](/post-quantum-encryption/) (ML-KEM + AES-256) keeping sensitive data private with a [zero knowledge](/zero-knowledge-encryption/) security architecture.

- Get 5GB quantum resistant storage forever
- Unlimited sharing, unlimited bandwidth and unlimited file size uploads
- Integrated Global CDN and preview media in 4k/8k

[Try DragBin Today](https://dragbin.com)

## How to Compress an Image or Video to a Specific Size

Set the limit, add your files, and download the ones that fit.

Step 1

Pick a maximum file size: 20 KB to 2 MB for photos, or 8 MB to 100 MB for videos. For images, choose a format and add an exact width and height if the form asks for one.

Step 2

Drop, paste or choose up to 50 images or videos. Each one is compressed as soon as it&#x27;s added; videos go one at a time.

Step 3

Check each final size against the limit, then download the files one by one or as a zip.

## Why Use This Tool to Hit a File Size?

An ordinary compressor asks for a quality setting and leaves you guessing at the result. This one works backwards from the size you need.

### Best Quality That Fits

It finds the highest quality under your limit, so a file loses no more detail than it has to, and logs every version it tried.

### Exact Dimensions Too

Need 600x600? Enter it, choose crop to fill or fit inside, and the size limit is applied after.

### Videos Under a Size Limit Too

It works out the bitrate the limit allows, drops to 1080p, 720p or 480p when that looks better, and saves an H.264 MP4 that plays almost anywhere.

## Your Photos and Videos Stay on Your Device

Compression runs inside your browser tab. Your images and videos are not uploaded to DragBin or anyone else.

### No Uploads

Your files never leave your device. When a browser can&#x27;t handle a format itself, such as HEIC outside Safari or AAC audio in Firefox, the page downloads the decoder or encoder from dragbin.com.

### Up to 50 at Once

Compress a batch of images or videos to the same limit and download them together as one zip.

### Phone or Computer

Images work in current Chrome, Edge, Firefox and Safari on desktops, phones and tablets. Videos need Chrome, Edge, Firefox on a computer, or Safari 16.4 or later.

## Try DragBin Today

Pair private, in-browser file tools with zero-knowledge, quantum-resistant cloud storage. 5GB free, forever.

[Claim 5GB free storage (opens in new tab)](https://app.dragbin.com/signup)

## Frequently Asked Questions

### How does it get an image under an exact file size?

It encodes the image at different quality levels and keeps the highest one that comes in under your limit. If even a low quality is too big, it reduces the width and height in steps and searches again until the file fits.

### Can the result ever be bigger than the limit I set?

No. A file is only offered for download if it is at or under the limit. If an image or video can&#x27;t get that small, it is marked as failed and the smallest size reached is shown instead. Sizes count 1 KB as 1,000 bytes, slightly stricter than 1,024, so the file fits whichever way a website counts.

### How does it fit a video under a size limit such as 25 MB?

It divides the size you pick by the video&#x27;s length to get the bitrate that fits, keeping 5% spare for the MP4 container. If that bitrate would look blocky at the original resolution, it lowers it to 1080p, 720p or 480p. AAC audio is kept as it is when it takes little of the budget; otherwise the sound is re-encoded to AAC at 64 to 96 kbps. The result is an H.264 MP4. If it still comes out over the limit, it tries up to twice more at a lower bitrate. When a video is too long for the limit, it says so and gives the size it would need.

### Which videos work, and in which browsers?

MP4, MOV, WebM and MKV, up to 2 GB on a computer and 500 MB on a phone or tablet, one at a time. Videos are compressed with your browser&#x27;s built-in video encoder, so they need Chrome, Edge, Firefox on a computer, or Safari 16.4 or later; Firefox for Android can&#x27;t process video. iPhone HEVC footage works in Safari; in Chrome or Edge it depends on your computer&#x27;s hardware, and Firefox can&#x27;t decode it. Safari before version 26 can&#x27;t re-encode audio, so if the sound has to be re-encoded there, the video is saved without it and the tool tells you. A long video can take several minutes, so keep the tab open.

### Should I save as JPG or WebP?

Choose JPG when a form lists the formats it accepts, because almost every site takes JPG. WebP usually looks better at the same size and keeps transparency, but some upload forms reject it. JPG has no transparency, so transparent areas turn white.

### What does the exact size option do?

It resizes each image to the width and height you enter before compressing. Crop to fill trims the edges so the picture fills the box exactly; fit inside keeps the whole picture, so one side may come out shorter. The tool won&#x27;t go below an exact size, so if an image can&#x27;t fit, try a larger file size limit or smaller dimensions.

### Are my images or videos uploaded anywhere?

No. Everything runs in your browser. If your browser can&#x27;t read or write a format by itself (HEIC outside Safari, AVIF in some older browsers, WebP output in Safari, AAC audio in Firefox), the page downloads the decoder or encoder it needs from dragbin.com. Your files are never sent to a server.

### Which image files can I use?

JPEG, PNG, WebP, AVIF, BMP, GIF and HEIC or HEIF, up to 50 at a time and 100 MB each. Animated GIFs use their first frame. Unless you set an exact size, photos above about 16.7 megapixels are scaled down to that before compressing so every browser can handle them.

More free tools

## Keep going with the DragBin toolbox

[

### Image Compressor

Shrink images by quality, without a fixed size limit.

](/tools/image-compressor/)[

### Image Resizer

Change image dimensions in pixels or percent.

](/tools/image-resizer/)[

### Crop Image

Trim a photo to the part that matters before compressing it.

](/tools/crop-image/)

---

Canonical: https://www.dragbin.com/tools/compress-to-size
