Skip to content
ByteNeat

Compress an image to an exact file size

Give a size in KB and get an image that fits under it. Built for upload forms with strict limits. Resize too, and nothing is uploaded — it all runs in your browser.

Drop an image here, or

JPEG, PNG, WebP, HEIC or GIF · never uploaded

When a form says "maximum 100 KB"

Upload forms on government portals, exam registration systems, visa applications and job sites routinely cap images at 20 KB to 200 KB. Those limits were often set a decade or more ago and never revisited. A photo from a current phone is 3 to 8 MB — up to four hundred times too large — and the form usually rejects it with nothing more helpful than "file too large".

This tool starts from the limit instead of from a vague quality slider. You give it a number in kilobytes and it searches for the highest image quality that still fits underneath, so you get the best-looking image that the form will actually accept.

How the search works

JPEG and WebP have a quality setting from 1 to 100, but the relationship between that number and the resulting file size is not predictable — it depends entirely on the content of the image. A flat graphic compresses far smaller than a detailed photograph at the identical setting, so there is no formula that maps a target size to a quality value.

So the tool searches instead. It encodes the image, measures the real byte count, and narrows the range — higher if there is room to spare, lower if it overshot. About eight rounds of halving the interval is enough to land close to the ceiling without going over. If even the lowest quality is still too large, it reduces the dimensions and starts again, because past a certain point there is simply no way to describe that many pixels in that few bytes.

Dimensions matter as much as quality

Many forms specify both a file size and pixel dimensions — a photograph at 200 × 230 and a signature at 140 × 60 are common combinations. Turn onLimit the dimensions too and set the maximum width or height; the image is scaled to fit inside that box, keeping its proportions, before compression runs.

This also helps enormously with tight targets. Squeezing a 4000-pixel-wide photo into 20 KB at full resolution produces a blurry mess, because there are nowhere near enough bytes to go around. Scaling it to 600 pixels wide first and then compressing looks dramatically better at exactly the same file size.

A note on PNG

PNG is lossless: it must reproduce every pixel exactly, so it has no quality dial to turn. The only way to shrink a PNG is to reduce its dimensions, which is what happens when you select it here. If your image is a photograph and you do not need transparency, switching to JPEG will shrink it far more while looking essentially identical.

Rotation and privacy

Phone cameras frequently store an image the "wrong" way up and attach an EXIF orientation flag telling viewers how to rotate it. Tools that ignore that flag output sideways photos. This one reads and applies the orientation, so what you download matches what you saw.

Nothing is uploaded. Compression runs in your browser using the standard canvas API — no encoder to download and no waiting, so results are usually instant. That privacy matters here more than for most tools, because these forms typically involve passport photographs, signatures and identity documents.

Frequently asked questions

How do I compress an image to exactly 50KB?

Type 50 into the target box, or press the 50 KB preset, and drop your image in. The tool repeatedly re-encodes the image, searching for the highest quality setting that still lands under 50 KB. It reports the exact final size, which will be just below your target rather than just over it.

Why do upload forms have such small size limits?

Government portals, exam registration systems, visa applications and job sites often cap uploads at 20 KB to 200 KB, usually because the limits were set long ago and never revised. A modern phone photo is 3 to 8 MB, so it can be fifty times too large, and the form typically rejects it without explaining how to fix it.

Will compressing ruin the image quality?

It depends how far you are pushing it. Getting a phone photo down to 200 KB is usually barely noticeable. Forcing it to 20 KB will visibly soften detail and may show blocky patches. Reducing the dimensions as well as the quality almost always looks better than keeping full resolution at a very low quality setting.

Can I also change the image dimensions?

Yes. Set a maximum width or height and the image is scaled down before compression, keeping its aspect ratio. This is essential when a form demands specific pixel dimensions as well as a file size limit, and it makes hitting very small targets far easier.

Which format should I choose?

JPEG is the safest choice and what nearly every upload form expects. WebP produces noticeably smaller files at the same visual quality but is rejected by some older systems. PNG is lossless, so its size can only be reduced by shrinking the dimensions — choose it only if you need transparency or perfectly sharp text.

Are my photos uploaded to a server?

No. Everything happens in your browser using the standard canvas API. Your image is never transmitted, which matters because these forms usually involve identity documents, passport photographs and signatures.

Why is my PNG barely getting smaller?

PNG is a lossless format, so there is no quality dial to turn — it must reproduce every pixel exactly. The only way to shrink a PNG meaningfully is to reduce its dimensions, which is what this tool does when PNG is selected. If you do not need transparency, converting to JPEG will shrink it dramatically.

Does this rotate my photo correctly?

Yes. Photos taken on phones often store their rotation as EXIF metadata rather than rotating the actual pixels, which is why some tools output sideways images. This tool reads that orientation flag and applies it, so the result appears the right way up.

Last updated .