Guides

How to shrink an image to a specific file size

Upload forms love to reject photos for being a few kilobytes too big. Here is how to hit a hard size limit while keeping the picture as sharp as the limit allows.

You have a photo, and a form that insists it be under some number: 200KB for a job portal, 100KB for a marketplace listing, 50KB for a profile picture, or the notoriously tight 20KB some government and exam sites demand. You upload, it bounces, you shrug. This guide explains the two levers that actually control file size and how to use them to land under any limit without the result looking like a smudge.

Two levers: quality and dimensions

Image file size comes down to two things. The first is compression quality: how aggressively a JPG discards fine detail. Turning quality down shrinks the file without changing how big the picture appears on screen, at the cost of some sharpness. The second is dimensions: how many pixels wide and tall the image is. A 4000-pixel-wide photo has roughly four times the data of a 2000-pixel one, so resizing has a huge effect on size.

The order matters. If your image is enormous in dimensions, resize it first, because there is no point storing a 4000-pixel photo for a spot that displays it at 300 pixels. Once the dimensions are sensible, use compression to fine-tune the last bit and hit your exact target. In practice, a quality slider handles most everyday cases, and a resize step handles the ones where the photo is simply too large to begin with.

Hitting an exact number automatically

Guessing at a quality slider until the file happens to fall under 100KB is tedious. The faster route is a tool that targets the number for you: it compresses, checks the resulting size, and keeps lowering quality in small steps until the file fits under the limit. That is exactly what the size-specific tools do, so you can go straight to the target you need:

Getting the sharpest result at a tight limit

When the cap is small, every kilobyte counts, so give them to the part of the image that matters. A few habits help a lot:

Common size limits and what they are for

Different limits exist for different reasons, and knowing the reason tells you how hard to push. A 20KB cap almost always means a signature or thumbnail field on an official form, where the image is tiny on screen anyway, so a heavy crop is your friend. A 2MB or 5MB email limit is generous, and you usually only need light compression, not resizing. A 100KB to 200KB web limit sits in the middle, comfortable for a properly sized photo at good quality. When in doubt, aim a little under the stated cap, because some systems measure slightly differently than your computer does.

A quick workflow

Put together, the process is short. Crop out anything you do not need. If the photo is far larger in pixels than where it will be shown, resize it down. Then run it through the compressor or the exact-size tool for your target and check the number. If it is still over, drop the dimensions a little more rather than crushing the quality further, since a smaller sharp image beats a full-size blurry one almost every time. All of this runs inside your browser here, so the photo never leaves your device on the way to fitting the box.

Advertisement

Tools mentioned in this guide

Read more guides