OPTIMIZE

Compress Image to a Size

Give it a limit — 100 KB, 500 KB, 2 MB — and it searches for the best quality that still fits underneath.

OPTIMIZE

☞ runs entirely in your browser — nothing is uploaded

Drop an image here

Up to 50 MB — it never leaves your device

a limit, not a slider

When the requirement is a number

Upload forms are full of hard limits. A job portal takes a photo under 200 KB, a government form caps attachments at 1 MB, a forum rejects avatars over 100 KB. None of those are asking you to pick a quality level — they are asking for a file that fits, and the usual compressor makes you guess at a slider and check the result over and over.

This one works from the other end. You give the limit, and it encodes the image repeatedly, narrowing in on the highest quality that still comes in underneath. Quality is tried first because it costs the least detail. Only if the smallest reasonable quality is still too big does it start reducing dimensions, and when it does, it says so.

three steps

How to compress an image to a target size

01

Drop an image in

JPG, PNG and WebP all work. Nothing is uploaded — the encoding happens in your browser, which is also why you can watch the search count up.

02

Type the limit

Pick a number and a unit, choose the output format, and press the button. Each step of the search is one full encode, so a large photo takes a few seconds.

03

Check and download

Drag the slider to compare against the original. The result line tells you the quality that was used and whether the image had to be resized.

quick answers

Compress to size FAQ

Will the result be exactly the size I asked for?

No, and it should not be. The target is a ceiling, not a goal. Padding a file out to hit a number exactly would mean throwing away quality you did not need to lose. What you get is the largest file that still fits under your limit, which is the same thing as the sharpest image that fits.

Why does it take a few seconds?

Because every step is a real encode of the full image. There is no formula that predicts JPEG size from a quality number — it depends entirely on the content, which is why a flat graphic and a detailed forest photo behave nothing alike. The search runs about eight encodes to narrow the range, and the button counts them as it goes.

What if my target cannot be reached?

You get the smallest result that was achievable, clearly labelled as not having reached the target. That is deliberate. A tool that quietly hands back an unreadable image and calls it a success is worse than one that admits the request was impossible. If it happens, try allowing resizing, or pick WebP, which usually reaches a given size at a visibly higher quality than JPG.

Why is PNG treated differently?

Because the quality setting does nothing for PNG. It is a lossless format, and the browser's encoder ignores the quality argument entirely, so re-encoding at a lower number produces exactly the same bytes. The only lever left is making the image smaller in pixels. If you need a small file and do not need lossless, JPG or WebP will do far better at the same size.

Should I pick JPG or WebP?

WebP, unless something you are uploading to will not accept it. At any given file size it holds noticeably more detail, and every current browser displays it. JPG remains the safer choice for older software and for forms that check the extension.

Does resizing happen automatically?

Only when quality alone cannot reach the limit, and only if you leave that option enabled. The order matters: lowering quality discards subtle detail, while shrinking discards pixels outright and cannot be undone. When the tool does resize, the result line reports the percentage it used.

Is anything uploaded?

No. Every encode in the search runs in your browser and the file never goes to a server, which is what makes this practical for ID photos and documents you would rather not hand to a website in the first place.