Compress an image to an exact size
Give it a photo and a number in KB. It finds the highest quality that fits underneath your limit — and keeps the full dimensions unless it genuinely cannot. Nothing is uploaded.
Why forms ask for a size in kilobytes
Almost every request to compress an image to an exact size comes from a form that will not accept it otherwise. Government portals, university applications, job sites and visa systems set hard byte limits — 20 KB for a signature, 50 KB for a passport photograph, 100 or 200 KB for a scanned certificate — and reject anything above them without explaining what to do about it.
Those limits exist because the systems behind them were built when storage was expensive and are rarely revisited. A modern phone photograph is between three and eight megabytes. A form asking for 50 KB is asking for roughly one percent of that, which is why simply "saving a smaller copy" never works.
How this reaches a number you choose
A JPEG's size is governed by a quality setting between 0 and 1, but the relationship is not linear and depends entirely on the picture: quality 0.6 might produce 40 KB for a plain document scan and 400 KB for a detailed landscape. There is no formula, so the only reliable method is to encode, measure, and adjust.
- The image is encoded at a middling quality and measured.
- If it fits, quality goes up; if it overshoots, quality comes down. This repeats seven times, halving the remaining range each time.
- That converges on the highest quality that still fits underneath your target, to within about half a percent.
- Only if no quality setting reaches the target do the dimensions come down a step, and the search runs again.
The order matters. Reducing dimensions first is the easy way to hit any target, but it hands back a small blurry picture when a slightly softer full-size one would have been accepted. Quality is spent first for the same reason a photographer stops down before reaching for a smaller sensor.
Which format to choose
| Format | Compression | Use it for |
|---|---|---|
| JPEG | Lossy, adjustable | Photographs, scans, anything from a camera. The only format that can hit an arbitrary size target. |
| PNG | Lossless, fixed | Screenshots, logos, diagrams, line art. Sharp edges and flat colour survive; photographs stay large. |
If a form does not say which it wants, send JPEG. It is the format these systems were built around, and it is the only one where a size limit is reliably reachable.
Typical limits, and what survives them
| Limit | Commonly asked for | What you can expect |
|---|---|---|
| 10–20 KB | Signatures | Fine. A signature is black ink on white and compresses extremely well. |
| 50 KB | Passport photographs | Comfortable at passport dimensions. Full-frame phone photos will be resized. |
| 100–200 KB | Certificates, ID scans | Usually keeps full dimensions with a modest quality reduction. |
| Under 10 KB | Thumbnails, some older portals | Expect visible artefacts, and expect the dimensions to come down. |
Getting a better result
- Crop before you compress. Every pixel of desk, floor or fingertip in the frame costs bytes that could have gone to the document. Cropping tightly is the single largest improvement available.
- Photograph in even light, not flash. Flash creates a bright hotspot and hard shadows, both of which are fine detail that JPEG spends bytes describing.
- Keep the camera parallel to the page. A skewed photo wastes frame area and is harder to read once quality drops.
- Start from the original, not a forward. An image that has been through WhatsApp or email has already been compressed once; compressing it again stacks artefacts.
- Keep your original file. Compression is not reversible. If the form rejects the result for another reason, you want the full-quality version to go back to.
Common questions
Does it really hit the exact size I ask for?
It gets as close underneath your target as it can without going over, which is what an upload limit actually requires. A 100 KB target typically lands in the high 90s. It will not pad a file out to hit the number precisely - a smaller file is never a problem for a form that says "maximum 100 KB".
Will it shrink the photo’s dimensions?
Only if it has to. Quality is reduced first, because most forms want the picture to still be legible at full size. Dimensions are only reduced when no JPEG quality setting reaches your target, and the result tells you if that happened.
Why is my PNG barely getting smaller?
PNG is lossless - it has no quality dial to turn down, so the only way to make it smaller is to reduce its dimensions. For photographs, switch the output to JPEG, which is what portals expect anyway. PNG is the right choice only for screenshots, logos and line art.
My photo came out sideways on other tools. Will it here?
It should not. Phone cameras record rotation as EXIF metadata rather than rotating the pixels, and tools that ignore it produce sideways images. This one applies the orientation before compressing.
Is my photo uploaded anywhere?
No. The compression runs in your browser using the same canvas your device already uses to display the image. Nothing is sent to a server, which matters here because the images people resize are usually passport photos, signatures and ID documents.
The result came back larger than the original
That means the file was already well optimised, so re-encoding it could only add bytes. When that happens your original is returned unchanged rather than a worse, bigger version of it.