Compress an Image to an Exact KB Size: Practical Tips and Common Mistakes
Reviewed by the FreeOnline.fyi team · Updated 2026-09-10
Most upload forms — visa portals, job boards, eBay listings, government ID check
Most upload forms — visa portals, job boards, eBay listings, government ID checks — enforce a hard ceiling of a few hundred kilobytes. When your photo comes back at 612 KB and the limit is 500, you can't argue with the server.
We've watched countless people give up and re-take a perfectly good passport photo with their phone on the lowest setting, ending up with a blurry result that then gets rejected for being unreadable. The real fix is shrinking the file in a controlled way, which is exactly what our image compressor to a target KB size is built for.
Before we get into the practical side, a quick note on what's happening under th
Before we get into the practical side, a quick note on what's happening under the hood. The tool runs entirely in your browser — your photo never touches a server — so it's safe to use with passport scans, ID documents, or anything else you'd rather not hand to a random website.
The compression is a quality-based re-encode (for JPG and WebP) and a colour-quantisation step (for PNG), iterated until the file lands as close to your target as possible. If you're curious about how each format behaves under the hood, the MDN guide to image types is a solid reference.
Start by picking a sensible target rather than guessing.
Start by picking a sensible target rather than guessing. If the form says "max 240 KB", don't type 240 and hope — type 230. That small headroom covers the fact that the same image re-encoded twice can land a kilobyte or two higher the second time, especially across different browsers and operating systems.
The tool shows you the original and compressed size side-by-side, so you can see the actual delta. If you're still over, drop the target by another 10 KB and try again; that's faster than fighting with advanced controls. Targets below about 20 KB on a typical photo will start to look noticeably soft, so don't aim lower than you need to.
The single biggest mistake we see is cranking the quality slider down before cha
The single biggest mistake we see is cranking the quality slider down before changing anything else. Dropping quality to 10% does shrink the file, but it also introduces banding, blocky artefacts and mushy edges around text — exactly the kind of damage that gets passport photos rejected on automated checks.
For most photos, the sweet spot lives between 60% and 80% quality when paired with a sensible target KB. If you really need to go smaller, cap the width first: a 1200-pixel-wide image can usually be resized to 800 pixels with no visible loss on a 4×3 cm print, and that alone often halves the file size. Mobile portals in particular tend to rescale whatever you upload to a fixed width, so feeding them a smaller original rarely hurts.
For PNGs specifically, the format is lossless by design, so the tool uses a diff
For PNGs specifically, the format is lossless by design, so the tool uses a different strategy: reducing the colour palette. That works well for screenshots, logos and diagrams, but a photo saved as PNG will always end up larger and a touch posterised.
If the upload form accepts JPG or WebP, switch to one of those — JPG for photos, WebP for both photos and graphics when the portal supports it. Google's web.dev guide to choosing the right image format has a useful decision tree for this. WebP typically beats JPG by 25–30% at the same visual quality, but only modern portals accept it, so check first.
A quick checklist before you hit download: confirm the output dimensions match w
A quick checklist before you hit download: confirm the output dimensions match what the form expects — some portals reject images that are over 1000 pixels wide even if they're small in KB. Check that the file actually opens in your phone's gallery, and if it's an ID-style photo, look at the face — the eyes must be sharp.
Finally, if the tool rounds your result up by 1–2 KB on a very tight limit, re-run it with a slightly lower target; the encoding is largely deterministic on the same browser, so a one-step nudge is usually enough to land you under the ceiling. For everything else on the site, browse the rest of the FreeOnline.fyi free online tools.