How to Compress an Image to a Specific File Size

Step-by-step guide to hitting an exact file-size target when compressing images — whether the limit is 100KB, 500KB, or 2MB. Works in your browser, no upload required.

Most image upload forms announce a file-size limit without explaining how to hit it. Whether the cap is 100KB, 500KB, or 2MB, the fix is the same: adjust two variables — compression quality and pixel dimensions — until the output lands where you need it.

The two knobs that control file size

Quality is the main lever for photos. JPEG compression discards image data the eye generally won't notice, and the relationship between quality and file size is steep. A smartphone JPEG at quality 90 might weigh 2.1MB; at quality 75 it's roughly 700KB; at quality 60 it's around 300KB. The perceptible quality difference between 90 and 75 is minimal on most screens.

Pixel dimensions are the second lever. A 4000×3000 image has four times as many pixels to store as a 2000×1500 one. Halving the long edge shrinks file size by roughly 75%, independent of quality. Resize first, then compress — or do both at once.

A worked example: phone photo to 500KB

A typical smartphone photo shot at full resolution is a 4608×3456 image that weighs around 4.8MB.

Step 1 — resize. Scale to 1920px on the long edge. At original quality this drops the file to about 1.4MB — still too big.

Step 2 — lower quality to 75%. The file lands at roughly 400–480KB, well under 500KB. The photo looks identical on a monitor.

That two-move sequence (resize to 1920px + quality 75%) reliably clears a 500KB ceiling for ordinary photos. For a 200KB target, resize to 1500px and lower quality to 65%.

Step-by-step process

  1. Open the image in a browser-based compressor.
  2. Start with quality at 80% and check the output size.
  3. Still over your limit? Try one of:
    • Drop quality by 5–10 points.
    • Reduce the longest dimension by 25%.
    • Do both.
  4. Repeat until the output size is at or just under the target.
  5. Download.

The key advantage of a browser-based tool is that the output size updates as you drag the slider, so you can dial in the target precisely without guessing and re-uploading.

Reference: common targets and starting settings

TargetQuality to tryMax dimension
2MB85–90%2000px
500KB70–80%1920px
200KB60–70%1500px
100KB50–65%1200px

These are starting points for photos. A detailed landscape holds more data than a portrait with a blurred background, so it'll be larger at the same settings. Adjust from there.

When quality alone isn't enough

If you're already below quality 55 and still can't reach the target, dimensions are the bottleneck. A 4000px photo can't reach 100KB at acceptable quality — it simply contains too many pixels to encode that tightly without visible degradation. Resize it down to 1000–1200px first, then compress.

For headshots, product shots, or anything that only needs to look good on a webpage, 800–1000px wide is plenty. At that width, quality 70 typically lands between 80–130KB.

Format: JPG vs PNG

If your source is a PNG photo, converting to JPG before you compress can cut the file by 60–80% on its own. PNG is a lossless format built for graphics with sharp edges — logos, screenshots, diagrams — not photographs. When someone emails you a PNG photo or a camera saves one, switch formats first and you may not need heavy compression at all.

Stick with PNG when:

  • The image has a transparent background.
  • It's a logo, icon, or screenshot with solid-color areas and sharp text.

Why this matters more than the tool you use

The mechanics above work the same regardless of which compressor you use. What varies between tools is where the processing happens. Many online compression sites upload your file to a server — fine for a product photo, less ideal for a passport scan, medical document, or anything personal. A browser-based compressor processes everything locally; the image never leaves your device.

Advertisement

Frequently asked questions

How do I know if I've compressed an image too much?

Look for blocky patches, smeared edges around high-contrast areas, and washed-out fine details like hair or grass. These JPEG artifacts appear when quality drops below roughly 50–55%. If the photo still looks clean at your target size, you haven't compressed too much.

Can I compress a PNG to a specific size?

Yes, but if the PNG is a photo, convert it to JPG first — that alone can cut the file size by 60–80% before you touch any quality slider. Keep PNG only for images with transparency or sharp-edged graphics like logos and screenshots.

What if the form still rejects my image after I hit the size limit?

Some upload fields check pixel dimensions, not just file size. Look for a note like '800×600 maximum' or 'at least 300 DPI' in the requirements. Resize to the required dimensions and compress again.

Related guides