How to compress an image to an exact KB size — without uploading it anywhere
Reviewed by the FreeOnline.fyi team · Updated 2026-09-10
Most upload forms are picky about file size.
Most upload forms are picky about file size. A job portal insists the headshot is under 200 KB, the visa application wants your photo between 50 and 240 KB, an eBay listing rejects anything over 1 MB for the free tier, a school's registration form flat-out refuses a 4 MB iPhone JPEG. We've hit all of these ourselves, and the frustrating part isn't the editing — it's the resave, recheck, resave loop in a desktop image app. So we built a small browser tool that compresses a JPG, PNG or WebP to a target KB value in one pass, with the result ready to download immediately.
The reason we kept it browser-side isn't just convenience. When a CV photo or a passport scan leaves your machine, it lands on someone else's server — usually logged, usually retained for at least a few hours. For a CV or passport image, that's an unnecessary copy of a sensitive document sitting in a stranger's bucket. Our image compressor to a target KB size does the re-encode locally with the Canvas API; the original never leaves your browser tab. We confirmed this in the source: there's no fetch to a backend, no upload progress bar reaching a server, just a Blob URL you click to save.
Using it is deliberately short.
Using it is deliberately short. Open the page, drop a file into the left-hand drop-zone (it accepts JPG, PNG and WebP up to 20 MB), and the right-hand panel immediately shows the original size in KB. Type your target — 100 KB is the default, the input accepts anything from 5 to 5000 — and the compressed preview appears within a second or two for typical phone photos. You'll see the new size in monospaced numerals next to the original, plus a percentage delta so you can tell at a glance whether it undershot or overshot. When you're happy, click the Download button; the file lands with the same name and a sensible extension based on the format you chose.
Three controls actually move the needle. **Output format** defaults to Auto, which keeps the original container, but switching PNG to JPG usually slashes a screenshot's size by 60–80% because PNG is lossless. **Max width in pixels** is the second lever: a 4032×3024 phone photo can usually be capped to 1600 px wide without anyone noticing, and the byte saving dwarfs anything quality tuning can do. **Minimum quality** is an advanced toggle (hidden behind a "More options" disclosure, default 30%); we drop it to 10% when a stubborn PNG won't get under the target, and accept the visible artefacts because the file is destined for an upload form, not a print. Mozilla's image format reference on MDN is a good place to read up on which formats tolerate which quality floors.
An honest note on "exact".
An honest note on "exact". The tool hits the target as closely as it can — it iterates quality settings until the file is within a small tolerance — but it can't guarantee a precise byte count, because JPEG and WebP encoders don't expose that knob directly. In our testing a 240 KB target on a 1.8 MB portrait usually lands within ±3 KB, which is well inside any upload form we've seen. GOV.UK's passport photo guidance, for example, accepts files between 50 KB and 10 MB, so you'll comfortably clear it. If you need an exact byte match for a very strict portal, leave the target a few KB below the limit — that gives the encoder room to land.
If you're batching several images — a product catalogue, say, or a stack of visa scans — the tool handles one at a time but the loop is fast enough that ten images takes a couple of minutes. For the rest of your prep work, the FreeOnline.fyi free online tools page has a password generator for the throwaway email you end up creating on every job portal, which is the kind of small annoyance this whole family of utilities exists to remove.