PDF and Image Tools

Compress Image to Target File Size

Choose an image and a size limit to get a file at or under that size.

Your files stay on your device. They are processed in your browser and are never uploaded to SumPanda.

The image is read and saved in your browser and nothing is uploaded. Metadata such as the camera and location is not copied. PNG output is not offered because a PNG cannot be squeezed to a chosen size by quality alone.

Next step

How to use the compress image to target file size

  1. Choose an image: JPG, PNG, WebP, GIF, BMP or AVIF, up to 25 MB.
  2. Enter the largest file size and choose KB or MB. Choose JPG or WebP for the saved file.
  3. Set the lowest quality you will accept. Tick the box if the tool may make the picture smaller when lowering quality is not enough.
  4. Press the button. The tool shows each step it tried, then saves a file that is at or under your limit.

How it finds the size

JPG and WebP files get smaller as the quality setting falls, but the size for a given quality depends on the picture, so the tool has to try. It first saves the picture at a high quality. If that is already under your limit, you are done. Otherwise it saves at the lowest quality you allow. If that fits, it narrows in between the two qualities by halving the gap eight times, always keeping the best quality that was under the limit. If even the lowest quality is too big and you allowed it, the tool keeps that quality and shrinks the picture, again by halving the range of sizes, to find the largest picture that fits.

Every step is a real save in your browser, and the file you get is one of those saves, so its size has been measured. This matters because file size does not always fall smoothly with quality. The tests use a made-up size model with noise to check that the result is always a size that was really measured and never over the limit, and compare the quality found with a brute-force scan.

Choosing settings

Sizes use 1 KB = 1,000 bytes and 1 MB = 1,000,000 bytes, as most upload forms do. A quality of 40 percent is an example setting for the lowest quality; below that, JPG pictures show blocks. JPG has no transparency, so transparent areas turn white. If your browser cannot save WebP, choose JPG. PNG output is not offered, because a PNG cannot be reduced to a chosen size by quality alone.

To compress several images with a slider, use the image compressor. To change the pixel size on purpose, use the image resizer, to see what a size means, the image file size calculator, and to change the format, the image converter.

Assumptions and limits

  • The picture is saved by your browser's own encoder, so results differ a little between browsers.
  • The lowest quality and the smallest picture size (10 percent of the original) are limits the search will not cross.
  • Metadata such as the camera and location is not copied to the new file.
  • The image is read and saved in your browser and nothing is uploaded.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

Why does the tool shrink the picture instead of lowering the quality further?

Below a certain quality, a JPG looks blocky. A smaller picture at a decent quality usually looks better than a large one at a very low quality. You can switch the shrinking off and get a message instead.

What if my limit is too small?

If even the smallest picture at the lowest quality does not fit, the tool says so and does not save anything. Choose a larger limit or a different format.

Is the result exactly at my limit?

It is at or under the limit, usually within a few percent of it. The search stops after a fixed number of steps, so it does not squeeze out the last byte.

Why can WebP fail in some browsers?

Some browsers cannot save WebP from a page. The tool detects this and asks you to choose JPG.