Image Compressor to 100KB, 50KB or Any Size
Compress images to a target file size or quality, in batches, in your browser
Drop up to 20 images or click to choose
JPG, PNG, WebP, GIF, BMP, AVIF · compressed in this tab, never uploaded
How the target-size compression works
Most upload forms do not care about quality settings; they care about a number. A job portal wants a photo under 50KB, an exam form wants a signature under 20KB, a CMS rejects anything over 200KB. Target file size mode answers that directly. Pick a preset (20, 50, 100, 200 or 500 KB) or type a custom limit, and the tool binary-searches the encoder quality for the largest file that still fits under it. It encodes at high quality first; if that already fits, you get that file. Otherwise it halves the quality range seven or eight times, each time keeping the best result that passed, so you end up with the sharpest image that meets the limit rather than an arbitrarily crushed one.
Sometimes quality alone cannot get there. A 12-megapixel phone photo will not compress image to 20KB at any JPEG quality, because even the lowest setting still has to describe millions of pixels. When the option to shrink dimensions is on, the tool reduces the width and height in steps (estimated from how far over the target it landed) and searches quality again at each size, stopping at 64 pixels on the long side. You can also set a max width and height up front; images smaller than that box are never upscaled.
Everything runs in your browser. Each image is decoded with createImageBitmap, drawn onto a canvas and re-encoded with canvas.toBlob, so no file is uploaded anywhere. Orientation from the photo's EXIF data is applied before drawing, so portrait shots stay upright. A side effect of re-encoding through a canvas is that EXIF metadata, including GPS location and camera details, is not copied into the output. That is usually what you want before posting a photo publicly.
JPG, PNG and WebP: what each format can do
To compress JPG files, the tool lowers JPEG quality, which discards fine detail the eye is least likely to notice. Around 75 to 85 percent is usually indistinguishable from the original at a fraction of the size; below about 50 percent you start to see blocky edges and smeared text. To compress WebP, the same quality search applies, and WebP generally reaches a given size with fewer visible artifacts than JPEG. It also keeps transparency.
PNG is different, and it is worth being honest about it. PNG is lossless, so the browser's PNG encoder has no quality parameter. Re-saving a PNG through a canvas rarely makes it smaller, and sometimes makes it larger, because dedicated PNG optimizers use tricks (palette reduction, better filtering) that the browser encoder does not. This tool is therefore not a lossless PNG compressor. If you keep the output as PNG, the only way it can reduce image size is by reducing pixel dimensions. For a real cut, choose WebP output (smaller, transparency preserved) or JPG (smallest for photos, but transparent areas are filled with white). If re-encoding ever produces a file larger than your original at the same size and format, the original is kept instead.
You can drop up to 20 images at once, mix formats, and download each result individually or all of them as a single ZIP. The before and after panel shows both versions side by side with their sizes and dimensions so you can check quality before downloading.
How to use the Image Compressor to 100KB, 50KB or Any Size tool
- 1
Add your images
Drop up to 20 JPG, PNG, WebP, GIF or AVIF files onto the upload area, or click it to choose files.
- 2
Choose target size or quality
Pick a target such as 100KB or 50KB (or type a custom value), or switch to the quality slider for a fixed JPEG/WebP quality.
- 3
Set output format and limits
Keep the original format or convert to JPG or WebP, and optionally set a max width and height. Leave shrinking enabled if the target is very small.
- 4
Compress and download
Press Compress, compare before and after sizes and previews, then download each file or all of them as a ZIP.
Frequently asked questions
How do I compress an image to 100KB or 50KB?
Choose Target file size mode, click the 100 KB or 50 KB preset, and press Compress. The tool searches for the highest JPEG or WebP quality that fits under the limit. If the image is too large to fit even at minimum quality, leave the shrink option on and it will also reduce the dimensions.
Can I compress an image to 20KB without it looking bad?
It depends on the image. A small logo or a passport-size photo fits in 20KB easily; a full-resolution landscape photo will need to be scaled down considerably. Setting a max width (for example 600px) before compressing usually gives a cleaner result than letting quality drop to the minimum.
Why didn't my PNG get smaller?
PNG is lossless and the browser's PNG encoder has no quality setting, so re-encoding cannot trade quality for size. The only lever is fewer pixels. Convert to WebP to keep transparency at a much smaller size, or to JPG if the image has no transparent areas.
Are my images uploaded to a server?
No. Decoding, compressing and ZIP creation all happen in your browser tab using the canvas API, so the files never leave your device.
Does compression remove EXIF and location data?
Yes. The image is redrawn on a canvas and encoded fresh, and canvas output does not carry over EXIF metadata such as GPS coordinates or camera model. Orientation is applied to the pixels first, so the photo still displays the right way up.
Related on TechLogHub
Related Image Tools
Image to Base64
Convert images to Base64-encoded data URIs
Base64 to Image
Convert Base64 strings back to downloadable images
Image Resizer with Locked Aspect Ratio
Resize images client-side with custom dimensions
Image Cropper
Crop images with a visual selection tool
PNG to WebP & WebP to JPG Image Converter
Convert images between PNG, WebP, and JPEG formats
SVG to PNG Converter at 2x, 4x or Custom Width
Rasterise SVG to PNG, JPG or WebP at any resolution in your browser
Get the next tool before you need it
One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

