How to Compress an Image to a Target Size (100KB, 50KB, or 20KB)

Forms and uploads often cap images at an exact size like 100KB or 20KB. Here is how to hit a target file size reliably — which settings to turn first — and do it privately in your browser.

Updated June 11, 2026

Why an exact target size is tricky

Plenty of websites demand an image under a specific size — a 100KB passport photo for a visa form, a 50KB logo for a portal, a 20KB signature for a government upload. Unlike "make it smaller," a hard target means you have to land in a precise range, and a single quality slider rarely gets you there on the first try.

The good news: hitting a target is predictable once you know which controls move the size the most. You turn them in order, compress, read the resulting size, and re-run until you are under the limit.

The levers, in order of impact

When you need a smaller file, adjust these from most powerful to least:

  • Pixel dimensions (resolution). This is the biggest lever by far. File size scales with the number of pixels, so halving the width and height cuts the data to roughly a quarter. For tight targets like 20–50KB, capping the longest side to 800–1200 pixels does most of the work.
  • Quality. The compression quality (often shown as a percentage) trades fine detail for size. Dropping from 90% to 60% is usually invisible on screen but shrinks the file dramatically.
  • Format. For photos, WebP is typically the smallest at a given quality, with JPG close behind. PNG is much larger for photos — keep it for graphics, logos, and screenshots with sharp edges.

A useful rule: set the dimensions first to get in the right ballpark, then fine-tune quality to land exactly under your target.

Hitting common targets

  • Under 100KB — Many photos reach this with quality alone. In the Custom preset, set the max file size to 0.1 MB and lower quality until the output is under the cap. If it is still too big, drop the longest side to around 1200 pixels.
  • Under 50KB — Cap the longest side to roughly 800–1000 pixels and set quality to the 50–70% range. Use JPG or WebP.
  • Under 20KB — This is small. Reduce the longest side to about 600–800 pixels, set quality lower (around 40–60%), and prefer JPG or WebP. Compress, check the resulting size, and nudge the settings until you are under.

Because the tool shows the before-and-after size every time you compress, you are never guessing — adjust the settings, compress, read the result, and re-run if needed.

Form and passport photo notes

Government and visa forms are the most common reason people need tiny images, and they often add rules beyond size: a fixed pixel dimension (like 600×600), a specific format (usually JPG), or a minimum size as well as a maximum. Read the form's requirements first, set the exact dimensions it asks for, then use quality to land inside the size window. If there is a minimum size too, do not over-compress — back the quality up until you are comfortably inside the range.

Doing it privately, in your browser

A passport photo, an ID scan, or a signature is exactly the kind of image you should not upload to a random "compress to 100KB" website. A browser-based compressor resizes and re-encodes the image using your own device, shows you the resulting size after each compress, and saves it locally. Nothing is uploaded, so a sensitive document never leaves your computer — and it works offline once the page has loaded.

Quick checklist

  • Switch to Custom so you control quality, dimensions, and format.
  • Set pixel dimensions first — it is the biggest lever for tiny targets.
  • Use JPG or WebP for photos; reserve PNG for graphics.
  • Lower quality, compress, and check the resulting size — re-run until you are under the limit.
  • For forms, match the exact dimensions and format the form requires.

Quick steps

  1. 1Open the image compressor and drop your photo in. Switch to the Custom preset so you can control quality, dimensions, and format.
  2. 2Lower the quality first, then cap the dimensions, and choose JPG or WebP. After compressing, the tool shows the new file size, so re-run with stronger settings if it is still over.
  3. 3When the result is at or under your target, download it. Everything runs locally — the image is never uploaded.

Frequently asked questions

Start with the Custom preset, set the max file size to 0.1 MB (which is 100KB) and lower the quality, then compress; the result shows the new size, so adjust and re-run until it sits under your target. For very small targets like 20KB or 50KB, also reduce the pixel dimensions and switch to JPG or WebP — there is no way to fit a large photo into 20KB without shrinking its resolution.

The single biggest factor is pixel dimensions. A 4000-pixel-wide photo has far too much data to squeeze into 20KB no matter how hard you compress it. Cap the longest side (for example to 800 or 1000 pixels), then lower quality — the two together get almost any photo under a tight limit.

For photos, WebP is usually smallest at the same quality, followed by JPG; both beat PNG, which is best left for graphics and screenshots. If the form only accepts JPG or PNG, use JPG for photos to hit the smallest size.

Tools used in this guide

Related conversions