Image Compressor
Compress an image to a target file size - free, no upload.
Your image is compressed inside this page. It is never uploaded, and re-encoding drops any EXIF metadata from the copy you download.
What this tool does
Upload an image, set a target file size (or pick a common preset like 500 KB or 1 MB), and get a compressed version that fits, calculated by reducing JPEG or WebP quality via binary search - and automatically stepping down the dimensions too, if quality reduction alone can't reach an aggressive target.
Compresses your image toward a specific target file size, using binary search over JPEG or WebP quality rather than a fixed compression level.
Automatically reduces the image's dimensions, in addition to quality, when the target can't be reached by quality reduction alone - and says so explicitly rather than silently failing to hit your target.
Corrects EXIF orientation before compressing, so a phone photo stored sideways with a rotation tag compresses upright instead of rotated - the file is decoded, straightened onto a canvas, and only then re-encoded.
Tests maximum quality (95%) first before running any search, so a target that's easy to hit returns immediately instead of stepping through a full binary search unnecessarily.
How to use it
- Choose an image.
- Set your target file size, or pick a preset.
- Download the compressed result.
Why use this compressor
Large images slow sites and exceed upload limits. Aiming at a target size, rather than a quality guess, reduces files without needless loss.
Why we built it
We built the image compressor to reduce dimensions, not just quality, when an aggressive target cannot be reached otherwise. Compare quality with the image comparison slider and convert formats with the image format converter.
Related tools worth a look: the Rotate & Flip Image, the BMP to PNG and the SVG to JPG.
Handy alongside this: the Black and White Image Converter.
Who this tool is for
- Bloggers and web developers speeding up pages
- Anyone meeting an upload limit
- Sellers sending photos by email
When to use it
- Meeting an email or form size limit.
- Speeding up web pages.
- Shrinking photos for sharing.
- Preparing images for a CMS.
Why binary search instead of a fixed quality level
The right quality setting for a target file size is different for every photo.
A photo of a plain sky compresses to a tiny file at high quality, while a busy, detailed photo needs a much lower quality setting to hit the same target size - there's no one quality percentage that works for every image. This tool tests a quality level, checks the resulting file size, and narrows in via binary search until it finds the highest quality that still fits your target, rather than applying one fixed setting and hoping it happens to work for your specific photo.
What happens when quality alone can't hit the target
The search runs in two stages: quality first, then dimensions if quality wasn't enough.
The quality search is bounded between 5% and 95% - it never goes lower or higher than that - and runs for up to 8 narrowing passes after an initial check at 95% quality. If even the lowest allowed quality still produces a file larger than your target, the tool falls back to shrinking the image itself, redrawing it onto a smaller canvas at 75% of its previous width and height and re-running the quality search each time.
| Pass | Size vs. original |
|---|---|
| 1 | 75% |
| 2 | 56% |
| 3 | 42% |
| 4 | 32% |
| 5 | 24% |
| 6 | 18% |
The step-down loop stops early if either dimension would drop below 64 pixels, or as soon as a pass fits the target - so most images that need this fallback only lose a little resolution, not six full passes' worth.
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | One image. |
| Targets | A file size and JPEG or WebP. |
| Output | A compressed image with the achieved size. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| PNG will not shrink | PNG has no quality setting. | Choose JPEG or WebP. |
| Target is not reached | It is far smaller than possible. | Allow a larger size or smaller dimensions. |
| Image looks soft | Dimensions were reduced. | Choose a larger target. |
Assumptions and limitations
- PNG has no quality setting, so a target file size can't be hit for that format by re-encoding - choose JPEG or WebP instead.
- An extremely aggressive target (far smaller than the image could reasonably compress to) may not be reachable even after quality and dimension reduction; the tool says so rather than returning a broken result.
Frequently asked questions
How do I compress an image to a specific file size online for free?
Upload your image, set your target size, and the compressed result appears instantly, calculated by binary search over quality.
What happens if the target can't be reached by quality alone?
The dimensions are automatically stepped down as well, and the tool tells you when this happened and what size it settled on.
Can I compress to a target size in PNG?
No - PNG has no quality setting to reduce, so target-size compression only works for JPEG and WebP.
Does compressing remove EXIF metadata?
Yes - re-encoding the image drops EXIF metadata (camera info, GPS location, timestamp) from the compressed copy.
Is my photo uploaded anywhere?
No. Compression happens entirely in your browser - nothing is sent to a server.
Does compressing this image change its resolution?
Only if quality reduction alone can't reach your target. In that case, the dimensions are reduced in steps of 75% (up to 6 passes) until the file fits, and the result panel tells you the exact width and height it settled on.
Will a sideways phone photo compress in the wrong orientation?
No - the file's EXIF orientation tag is read and applied before compression, so the image is straightened first and the compressed copy comes out upright.