Guide
How to Compress an Image to a Specific Size
A repeatable method for landing on an exact byte count — 200 KB, 500 KB, 1 MB — instead of guessing at a quality slider and hoping.
Last updated · October 14, 2026
Almost every upload limit arrives as a number of bytes. A job portal wants “under 200 KB”. An email gateway caps attachments at 1 MB. A council form asks for 50 KB and rejects anything larger. Yet nearly every compressor on the web hands you a quality slider from 1 to 100 and leaves the arithmetic to you.
Here is the method that closes that gap, and how to apply it with this tool.
The Core Idea: Work Backwards from the Byte Count
The output size of a compressed image is a function of two things: how much detail you keep (quality) and how many pixels you keep (dimensions). You control both. So instead of asking “what quality looks good?”, ask “what combination of quality and dimensions fits inside 200 KB?”.
- Encode at the lowest acceptable quality. This gives you the floor for the current pixel count.
- If it fits, raise the quality back up. Bisect between the floor and the ceiling to find the highest quality that still sits under the target — you keep the most detail the budget allows.
- If it does not fit, reduce the pixel count. Scale the dimensions by roughly the square root of the overshoot, then repeat from step one.
- Stop when the file fits or you hit the floor. If you hit the floor, the image has told you its minimum — change the format or the target instead of grinding further.
That is exactly what happens when you press Compress in the tool above. You never see the loop; you just get a file that is at or under your chosen size.
Step by Step
1. Set the Target Before You Add Files
Open the tool and choose your size from the Target size dropdown. The presets run from 5 KB to 5 MB in the increments people actually get asked for. If your limit is something unusual like 175 KB, choose Custom size… and type the number.
2. Choose an Output Format Deliberately
- Auto picks WebP. It keeps transparency and lands roughly 25–35% smaller than JPEG at the same visual quality, which is usually the difference between hitting 200 KB and missing it.
- JPEG when a downstream system will not accept WebP — some legacy CMS uploaders and older email clients still balk at it.
- PNG only when you need mathematically lossless output. PNG ignores the quality control entirely, so size is driven purely by pixel count, which makes it very hard to hit an exact target.
3. Resize the Longest Edge If Quality Alone Is Not Enough
Dropping quality is the crudest lever — past a point you are trading visible blockiness for kilobytes. Resizing is almost always the better trade. Capping the longest edge at 1600 px typically cuts file size dramatically while staying sharp on any screen, because very few contexts display more pixels than that. Aspect ratio is preserved, so nothing is cropped.
4. Read the Result Before You Download
Each row reports the original size, the result, and the percentage saved, plus a status chip: on target means the file is at or under your number. Drag the Compare slider over the actual pixels to check that the detail survived — a file that hits 200 KB but has mush for a face has not really succeeded.
What to Do When It Will Not Reach the Target
Every image has a floor. A photograph packed with fine texture cannot be squeezed into 5 KB without becoming unrecognisable, and no amount of clever encoding changes that. When the tool cannot reach your target it says so and shows the smallest achievable size, rather than quietly handing you an oversized file.
Try these in order — each one buys real room:
- Switch to WebP. The single biggest win available, usually 25–35%.
- Lower the longest edge. Halving the dimensions quarters the data.
- Start from a less detailed source. A screenshot of a window compresses far better than a photograph of one.
- Reconsider the target. If a portal demands 50 KB for a photo, it is asking for a thumbnail — resizing will serve the intent far better than crushing quality to 2%.
Why the File Sometimes Comes Back Unchanged
If the original is already smaller than your target, the tool keeps the original bytes and marks the row already under target. Re-encoding a file that already fits would usually make it larger, and for GIFs and SVGs it would destroy an animation or the vector data entirely. If you do want a conversion anyway — for example a small JPEG to WebP — pick an explicit output format and the re-encode will run.
A Note on Privacy
None of this touches a network. The decode, the bisection loop, the resize and the final encode all happen inside this tab. Pull your ethernet cable after the page loads and the tool keeps working exactly the same. See the privacy policy for the details.
Common Targets and What They Are For
- 20–50 KB — favicons, small icons, form thumbnails.
- 100–200 KB — blog images, product shots, most portal upload limits.
- 300–500 KB — email attachments, high-quality web imagery.
- 1–2 MB — full-resolution sharing, portfolio exports.
- 3–5 MB — print-adjacent work where detail matters more than weight.
The full list of presets is on the target sizes section — clicking any one of them loads it straight into the tool.