Resize an image to an exact size in KB
Your form says “photo must not exceed 50 KB”. Most compressors shrink the file somewhere near that and leave you guessing. This one searches for the largest photo that still fits under the number you type.
- Nothing is uploaded — it runs in your browser
- 1 KB counted as 1024 bytes, like the forms do
- GPS and camera data stripped, orientation kept
Your photo never leaves this tab. The resizing happens inside your own browser — nothing is uploaded to us, and we cannot see the file.
JPEG, PNG or WebP, up to 25 MB. On a phone you can shoot it now.
How the exact size is found
JPEG has no “make this 50 KB” setting. It has a quality dial, and how many bytes a given quality produces depends on the photograph itself. So the size has to be searched for.
-
1
Decode in the tab
The image is read by your own browser. Rotation from the EXIF tag is applied so portraits stay upright; everything else in that block — camera model, timestamp, GPS — is dropped on the way out.
-
2
Halve the range, eight times
Encode, measure, and move the quality bounds toward the answer. Each pass cuts the remaining range in half, which is why eight passes are enough to land just beneath your limit rather than far below it.
-
3
Shrink pixels only if forced
If even the lowest usable quality overshoots, the picture is scaled down 10% and the search runs again. Losing resolution is the last resort, and the result tells you when it happened.
Why the result is usually a little under your number. Going over the limit means the form rejects the upload, so the search only ever accepts a file that fits. Landing at 48 KB against a 50 KB limit is the correct outcome — landing at 50.4 KB would be a failure.
What the tool actually does
Two ways to hit a size limit
| Approach | When this helps | Where it falls short |
|---|---|---|
| A general image compressor | Making a page load faster, where any reduction is a win and nobody checks the number. | It picks a quality level and hands you whatever comes out — 38 KB, 61 KB, 12 KB. When the form says “maximum 50 KB”, “whatever comes out” is a coin toss, and you compress again and again. |
| Compressing to a target (this tool) | Filling in a form that states a hard limit in kilobytes and rejects the upload if you miss it. | It only outputs JPEG. If your form demands PNG at a fixed weight, this is the wrong tool — and PNG cannot hit an arbitrary size anyway. |
When this tool is the wrong choice
Where this tool stops being the right answer — and what to use instead.
-
Your form demands PNG or a transparent background
The output is always JPEG, and JPEG has no transparency. Hitting an exact byte count needs a lossy format with a quality dial — PNG has no such dial.
What to do: Keep the PNG and reduce its pixel dimensions instead, or check whether the form really refuses JPEG.
-
You need to make a small photo bigger
Asking for 500 KB when your file is 80 KB cannot add detail that was never captured. The tool returns your original untouched and says so.
What to do: Re-take or re-export the photo at a higher resolution from the source.
-
The limit is tiny and the photo must stay readable
Below roughly 20 KB a face photograph starts losing the features the reviewer is checking. The tool will still hit the number, but it warns you.
What to do: Crop tighter to the face first — fewer pixels of background means more bytes left for the face.
-
You are compressing a scanned PDF
This is an image tool. A PDF is a document container and needs different handling entirely.
What to do: Export the page as JPEG first, or use a PDF-specific tool.
Words the forms use
- KB
- Kilobyte. Government portals mean 1024 bytes, so 50 KB is 51 200 bytes. Tools that use 1000 produce files that fail validation.
- JPEG quality
- A 0–100 dial trading detail for bytes. There is no fixed relationship between quality and file size — it depends entirely on the picture, which is why the size has to be found by search rather than by formula.
- EXIF
- Metadata your camera writes into the file: orientation, date, camera model, and often GPS coordinates. This tool keeps the orientation and discards the rest.
- Aspect ratio
- The width-to-height proportion. Compressing never changes it; cropping does. Forms that specify 3.5 × 4.5 cm are specifying ratio.