Compress Image to Exact Size (KB)
Compress an image to an exact target file size in KB or MB. The tool searches the encoder quality and, if that is not enough, scales the image down until the result fits under the limit you set. Useful for upload forms that reject files above a fixed size.
Overview
Many upload forms state a hard limit: a passport portal that refuses anything above 200 KB, a job board capped at 1 MB, a government form that requires the file to be under 500 KB. Resizing by eye rarely lands under the limit, and lowering the quality slider by hand means exporting and checking the size over and over. This tool automates that loop. You type the size you need, and it finds an encoder setting that produces a file at or below that size.
The search works in two stages. First the tool binary-searches the JPEG or WebP quality value, trying the midpoint of the current range and narrowing it based on whether the encoded result was above or below your target. If the lowest reasonable quality still produces a file that is too large, the tool scales the image down by ten percent and searches again, up to twelve times. Every result is measured by encoding it and reading the real byte length, so the size you are shown is the size you get, not an estimate.
PNG behaves differently and the tool is explicit about it. PNG is a lossless format, so there is no quality dial to turn: the only way to make a PNG smaller is to store fewer pixels. Choosing to keep PNG therefore reduces the dimensions, which is why the tool recommends converting photographs to JPEG and reserving the PNG option for images that need transparency or crisp text. If a target turns out to be unreachable, the tool says so and returns the smallest file it actually produced rather than silently pretending to have met the target.
Worked example
A 3.1 MB phone photo reduced to 97 KB for an Indonesian recruitment portal
An applicant in Surabaya is filling a recruitment form that refuses any upload above 100 KB. The photograph from the phone is a 3024 × 4032 px JPEG of 3.1 MB, and it still has to be recognisable at the small size printed on the form.
- Drop the file into the box, then click the 100 KB preset button. The unit switches to KB and the target box reads 100.
- Leave the PNG strategy panel alone, because the file is a JPEG. Leave Max width and Max height empty so the pixel dimensions are not touched unless they have to be.
- Press Compress image to 100.0 KB. The status line narrates the search: Searching quality — attempt 1/10 (2.48 MB), then attempt 2/10, and so on, with the measured size of every attempt.
- Continue reading the first row when it appears. It shows 3.1 MB to 97.4 KB, the dimensions 3024×4032 for both sides, the JPEG format, and a green Target met badge.
Result: The search settles at about 31 percent quality and reports 97.4 KB while keeping the full 3024 × 4032 px, so nothing had to be downscaled. The download is named foto-ijazah-97kb.jpg, with the achieved size in kilobytes in the file name. Had the target been out of reach at full size, the next step would have been shrinking the image by 10 percent and searching quality again, up to twelve times.
How to use Compress Image to Exact Size (KB)
- Add one or more images
- Type the target size and choose KB or MB
- Optionally set a maximum width or height
- Run the compression and download the results
Common mistakes
Choosing "Keep PNG (lossless)" for a photograph and typing a 20 KB target.
A lossless PNG can only get smaller by using fewer pixels, so a small target is often unreachable and the tool will say so rather than claim success. Choose "Convert to JPEG (recommended for photos)", which enables the quality search and reaches small targets. Keep PNG only when transparency must survive.
Typing 0.1 MB because the form says 100 KB. 0.1 MB is 104858 bytes, which is 102.4 KB and over the limit.
Use the unit the form uses. The preset buttons set exact KB values, and 100 KB here means 102400 bytes, which the tool treats as the ceiling.
Running the downloaded file through the tool a second time to shave off a few more kilobytes.
The first run already measured the smallest output it could produce at that target. A second pass re-encodes an already-compressed JPEG, losing more detail for very little gain.
Leaving a small Max width from an earlier attempt and losing resolution for no reason.
Keep the max width and height boxes empty unless a portal states a pixel limit. The quality search alone usually reaches the KB target, and empty boxes mean the pixels are only touched when the size cannot be reached otherwise.
Features
- Exact target size in KB or MB
- Quality search then downscaling
- Batch queue with per-file results
- Keeps the original when compression cannot help
- Runs locally, nothing uploaded
Limits worth knowing
- Only PNG, JPEG and WebP are accepted, and files above 60 MB each are skipped with a message. The smallest target the tool accepts is 1 KB.
- With "Keep PNG" the only lever is pixel dimensions, because PNG is lossless. If the target cannot be reached the tool reports the smallest size it actually measured instead of claiming success.
- Sources above 16.7 megapixels are scaled to fit the canvas and any side longer than 8192 px is clamped, so a 50 MP photo always loses pixels before compression even starts.
- If the re-encoded file would be bigger than your upload, the original bytes are kept and the row reads "(original kept)" rather than reporting a fake saving.
- Quality is searched in 10 measured steps between 5 and 95 percent, and downscaling moves in 10 percent steps up to twelve times, so a very small target takes a few seconds per image. The whole search is measured on your own device, so the photo only travels when you upload the saved copy to the portal.
When to use it
- A job applicant needs a photograph under 100 KB for an online application form and does not have image editing software installed.
- A student uploading an assignment to a portal with a 1 MB limit compresses a phone photo of a page without losing legibility.
- An online seller prepares product photographs for a marketplace that rejects images above 500 KB, processing the whole set in one queue.
- A traveller shrinks scans of documents to fit a visa application portal with a strict per-file limit.
- A developer preparing assets for a website reduces hero images to a set budget before committing them to the repository.
Practical tips
- Set the target a little below the stated limit, for example 190 KB for a 200 KB cap, because some forms measure in kibibytes rather than kilobytes.
- For a photograph, choose the JPEG option. PNG can only be reduced by removing pixels, which is much more visible than a moderate quality reduction.
- Use the maximum width and maximum height fields when the form also demands specific dimensions, since a smaller image needs less compression to reach the target.
- If the tool reports that the target is unreachable, the requested size is smaller than the image can express. Raise the target rather than accepting a heavily degraded result.
- Compressing an already compressed JPEG a second time loses more quality than compressing the original, so keep your source file.
Why use this tool
- Hit a hard upload limit on the first try instead of guessing at a quality setting and re-exporting until the file finally fits.
- See the real measured output size before you download, with the percentage saved and the new pixel dimensions.
- Keep the original file when compression cannot help: if the re-encoded result would be larger, the tool returns your untouched original.
- Process several images in one queue with the same target, which is what you need when a form accepts multiple attachments.
- Everything runs on your device, so a personal photograph or an identity document is never uploaded to a server.
When this is not the right tool
- You want a general reduction rather than one exact size, and a preset is good enough. — Image Compressor with the Balanced or Max Compression preset, which also handles a whole queue in one pass.
- The form states pixel dimensions as well as a size, for example 600 × 800 px under 200 KB. — Image Resizer first to set the pixels exactly, then this tool to hit the KB number without changing the dimensions again.
- A PNG must keep its transparency and the target is very small. — Nothing in the browser will square that circle. Reduce the pixel dimensions deliberately with Image Resizer and accept a physically smaller image.
Frequently asked questions
Does it really hit the size I type?
Yes, when the target is achievable. Every candidate is encoded and measured, and the tool reports whether the target was met. If it cannot be met it tells you and returns the smallest file it produced.
Why is my PNG still large?
PNG is lossless, so there is no quality setting to lower. Reducing a PNG means storing fewer pixels, which is why the tool suggests JPEG for photographs.
Are my images uploaded?
No. The whole process runs in your browser using canvas, so your files never leave your device.
Will the dimensions change?
Only if compression alone cannot reach the target, or if you set a maximum width or height. The result panel shows the source and output dimensions.
Related tools in Image Tools
- Image Resizer — The Image Resizer lets you resize images to exact dimensions or by percentage.
- Image to PDF — Image to PDF converts one or multiple images into a single PDF document.
- Image Converter — Free Image Converter — convert between PNG, JPG, WebP, GIF, BMP, and TIFF formats instantly.
- Image Compressor — Free Image Compressor — reduce image file size by up to 95% while maintaining visual quality.
- Screenshot Tool — The Screenshot Tool captures a still image of a screen, window, or tab that you choose in your browser picker.
- Passport Photo Maker — The Passport Photo Editor helps you crop and format photos to standard passport and visa dimensions for multiple countries.
- Batch Image Editor — A batch image editor is an indispensable tool for anyone working with large volumes of images, from professional photographers and e-commerce store ow
- Background Remover — A background remover isolates a subject by removing what is behind it.
- Photo Enhancer — An AI Photo Enhancer improves how a photo looks.