Compress Image to any size you choose
Tell us the size you need and we handle the rest. The compressor searches for the highest quality that still fits under any size you choose, reducing dimensions only if quality alone cannot get there.
Tell us the size you need. We handle the rest.
Drop your image here
or
Choose ImageYou can also paste an image with Ctrl+V
Images are processed on your device and never uploaded.
• •
Runs on your device — nothing is uploaded.
Working…
0%
- Original
- Result
- Saved
- Quality
How to compress an image to any size you choose
- Select your photo — JPG, PNG, WebP, HEIC and AVIF all work.
- The target is already set to any size you choose. Change it if you need a different ceiling.
- Press Compress.
- Check the result — it will be at or just below any size you choose — and download.
When you need a any size you choose image
Sometimes the limit is not a round number. A form says 240 KB, a client asks for 1.5 MB, a plugin refuses anything over 350 KB. Type the number and the same search that powers the preset pages runs against your value.
- Enter a value in KB or MB, including decimals.
- Use the preset chips as shortcuts when the number happens to be round.
- Batch-process a folder against one shared limit.
How the any size you choose compressor works
Hitting a byte target precisely is a search problem, not a formula. Here is what runs when you press the button:
- Analyse. The image is decoded and measured — dimensions, format, whether it has transparency, and its true byte size.
- Estimate. A first quality guess is derived from the ratio of any size you choose to the original size. This is only a starting point, never the answer.
- Binary search on quality. The image is re-encoded and measured, then the quality range is halved toward the target. Eight to twelve encodes are usually enough to land within a few percent.
- Reduce dimensions, but only if needed. If even the lowest
acceptable quality overshoots, the scale factor
√(target / current)is applied with a small safety margin and the quality search restarts at the new size. - Refine upward. If the first success lands well under any size you choose, the search tries a larger scale to spend the remaining budget on pixels rather than leaving it unused.
The result is the largest, sharpest image that still fits — not the first one that happens to be small enough. Landing at any size you choose minus a hair is the goal; landing at a third of any size you choose is a failure, even though it technically fits.
Getting the best quality at this size
Two rules of thumb when choosing your own number:
- Leave a small margin below a hard limit. If a portal rejects anything over 250 KB, target 245 KB — some systems measure after base64 encoding, which inflates the size by roughly a third.
- Do not aim lower than you need. Every kilobyte you leave on the table is detail you gave away for nothing.
Will the quality drop?
Some quality is always lost when a large photo is squeezed into any size you choose — the question is whether you will notice. The result panel shows an honest verdict:
- Excellent — indistinguishable from the original at normal size.
- Very Good — differences visible only when pixel-peeping.
- Good — fine for web and messaging use.
- Reduced — visible softening; acceptable for thumbnails and forms.
- Low — the target is aggressive for this image; consider raising it.
If you would rather keep every original pixel and accept whatever size results, tick Keep original dimensions in Advanced Settings — the tool will then solve with quality alone, and tell you if it cannot reach the target.
Supported formats
Input: JPG, PNG, WebP, GIF, BMP, HEIC/HEIF and AVIF. Output: JPG (default and smallest for photographs), WebP (smaller still, keeps transparency), or PNG (only sensible for flat graphics).
HEIC and AVIF decoders are downloaded on demand, so pages stay light for everyone who does not need them.
Frequently asked questions
Are my images uploaded to your server?
No. The image is decoded, processed and re-encoded by your own browser using the Canvas and Web Worker APIs. There is no upload endpoint for this tool — open your browser's network panel while you use it and you will see no request carrying image data.
What if my image is already under any size you choose?
The tool tells you so and offers the original file unchanged — there is no reason to re-compress something that already fits. You can still force a pass if you want it closer to any size you choose.
What is the smallest target I can set?
Around 5 KB is the practical floor for a recognisable photograph. Below that the tool will still produce a file, but it will flag the quality as Low and you should consider cropping first.
Can I set a target larger than my original file?
You can, but it has no effect — compression cannot add detail that was never there. The tool will report that the image already fits and offer the original.
Why is the result slightly under the target instead of exactly on it?
Encoders do not accept a byte count — they accept a quality setting, and the resulting size is whatever it is. The search aims for the 97–100% band below your target and never goes over, because a file one byte too large fails the upload it was made for.
What happens to my file when I close the tab?
It is gone. The image only ever exists in your browser's memory as an object URL; closing or refreshing the page discards it. Nothing is written to our servers, and nothing is stored on your device unless you download the result.