By Tim King · Updated
Compress Image to 200kb or Any Size, No Upload
Shrink a JPEG or WebP to an Exact kB Limit Using Binary Search
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Compress To KB works
This page will compress image to 200kb or any target size. Upload portals love to impose a hard limit — under 200 kB, under 1 MB, under 500 kB — and leave you guessing at a quality slider. Give this tool the limit instead and it finds the highest quality setting that fits underneath it, then shows you exactly how close it landed.
Compress image to 200kb: what it does and why
Compressing to a target size is a search problem, not a setting. The relationship between a JPEG quality number and the resulting file size depends entirely on the picture: a photograph of foliage at quality 70 may be four times the size of a studio portrait at the same setting, because one is full of fine detail the encoder cannot discard cheaply and the other is mostly smooth gradients. There is no quality value that reliably produces 200 kB.
How the search works. The tool encodes the image, measures the result, and adjusts. Because file size rises monotonically with quality, a bisection converges fast: it tries the midpoint of the remaining range, keeps the half that could still contain the answer, and repeats. Eight passes narrow a hundred-step range to a single value, which is why the result comes back in a second or two rather than after a hundred encodes. The stats show how many passes it actually needed and which quality won.
Under, never over. The search only keeps candidates that fit inside the budget, so the file it hands you is guaranteed to be at or below the limit — never a kilobyte over it. If the result comes back at 40 per cent of your budget, that usually means the image is simple enough that even high quality is small, and you could tighten the target.
Resizing is the escape hatch. If the tool reports that the image will not fit even at minimum quality, the problem is pixel count, not compression. A 6000-pixel-wide photo squeezed into 100 kB has roughly a hundredth of a bit per pixel to work with, and no encoder can make that look like anything. Set a maximum width instead. Halving the width quarters the pixel count, which means the same byte budget buys four times as much fidelity per pixel — a smaller, sharper image beats a large, smeared one every time.
JPEG or WebP. WebP reaches the same perceptual quality in noticeably fewer bytes, so for any given budget it will look better. Choose JPEG only when the destination demands it, which is still the case for some older upload forms, print workflows and email templates. Both are lossy here by design — a lossless format cannot be steered to a size target at all.
Transparency is flattened. Both output formats are written over a white background, because a JPEG cannot carry an alpha channel and mixing transparency into a size-targeted compression makes the result unpredictable. If you need transparency preserved, convert to WebP or PNG without a size target instead.
Everything happens locally. The file is decoded and re-encoded repeatedly by your browser's own canvas encoder. Nothing is uploaded, which matters more than usual here: the whole point of an upload limit is that the file is about to go somewhere, and it should not visit a second server on the way.
FAQ
Will the result always be under my limit?
Yes. Only candidates that measured at or below the budget are kept, so the download is never larger than the number you set. If nothing fit, you get an explanation rather than an oversized file.
Why does it say the image cannot fit?
Because at the lowest quality setting the file is still too big for the target at that pixel size. Set a maximum width to reduce the pixel count, which is the only remaining lever once quality has bottomed out.
Why is my result well under the target?
Because the next quality step up would have gone over it. Quality is a coarse dial and file size jumps between steps, so landing at eighty per cent of the budget is normal and means you got the best available quality.
Does it keep my photo's metadata?
No. The image is decoded to pixels and re-encoded, so EXIF, GPS coordinates and colour profiles are dropped. That is usually welcome; if you want metadata gone without recompressing, strip it instead.
Which format gives the smallest file?
WebP, by a comfortable margin at equivalent quality — often twenty to thirty per cent fewer bytes for the same apparent detail. Use it unless the place you are uploading to only accepts JPEG, which some older forms and print workflows still do.
See also: all Images tools, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.
Related tools
Image To WebP
Convert to WebP, JPEG or PNG with a quality slider.
Pixel Art Upscaler
Enlarge sprites 2× to 32× without blurring the pixels.
Image Filter Sandbox
Slide eight filter functions and copy the CSS declaration.
GIF Frame Extractor
Save any frame of an animated GIF as a PNG.
Image Size Calculator
Estimate image file size and see how oversized it is for its slot.