How to Compress an Image to an Exact KB Size
Step-by-step: compress any image to an exact KB size for unusual portal caps. Type the number, run the search, and verify the result.
The complete guide to compressing images to an exact KB or MB size: custom targets, binary search, scaling, and when to use it.
CompressMyPic Editorial Team · Published Nov 17, 2026 · 10 min read

Most compressors offer fixed sizes: 50KB, 100KB, 200KB, or 500KB. But what if your portal demands 80KB, or 150KB, or 1.5MB?
That is the job of the Target File Size Compressor. You type any size you need, and the tool compresses your image to hit exactly that number.
This guide explains how custom targets work, when to use them, and how to get the best quality at any size you choose.
Target compression lets you name the exact file size you want, in kilobytes or megabytes. The tool then works backwards to produce a file of that size.
You might type 80KB for a portal with an unusual cap, or 300KB for a blog theme with a specific budget. Any number works.
The tool uses the same binary quality search as the fixed-size tools. It tests quality levels until it finds the highest one that fits your number.
When quality alone cannot reach the target, intelligent dimension scaling steps in. The tool reduces pixel size gradually until the target is met.
The result is a file that lands just under your chosen size, with the best quality that size can hold.
Type your target size into the input box and choose KB or MB. The tool converts between units automatically when you switch.
Upload your image. JPG, PNG, WebP, and HEIC files are accepted, with inputs up to 25MB.
The tool runs its quality search at full resolution first. Only when that fails does it step the dimensions down.
A summary shows the result for each file: the target, the achieved size, and whether the target was hit or missed.
Batch mode compresses many images to the same custom target at once. Download them together as a ZIP file when the batch finishes.
Kilobytes suit small targets. Portal caps are usually stated in KB, like 80KB or 150KB, so type the number exactly as the portal states it.
Megabytes suit larger targets. A 1.5MB or 2MB target is easier to type and read in MB than as 1536KB or 2048KB.
Switching units recalculates the number for you. Typing 1MB and switching to KB shows 1024KB, keeping the target identical.
Be careful with rounding. A portal that says 100KB usually means 102400 bytes, and the tool measures in exact bytes to be safe.
When in doubt, type the number in the unit the portal uses. Matching the portal's own words prevents conversion mistakes.
Unusual portal caps are the main reason. A form demanding 80KB or 120KB cannot be served by a fixed-size tool.
Platform budgets are another. A blog theme or app may specify 300KB per image, and a custom target hits it exactly.
Testing is a third reason. Compressing the same image to 100KB, 150KB, and 200KB shows you exactly where quality stops improving.
Email attachments benefit too. A set of images that must total under 5MB can be tuned precisely with custom targets.
Fixed tools cover the common sizes. The custom tool covers everything else, which is a surprisingly large share of real work.
The tool does not guess a quality number. It searches for the best one, testing quality levels and narrowing the range each time.
Think of it like guessing a number between 1 and 100. Each test cuts the remaining range in half, so it converges in a handful of steps.
The search runs at full resolution first. That protects your dimensions, which matter more to most people than a small quality difference.
Only when the search fails at full size does scaling begin. The tool then tests smaller dimensions, again searching for the best quality at each step.
The result is the sharpest possible version of your image at the exact size you asked for.
Dimension scaling reduces the pixel size of your image when quality cuts alone cannot reach the target. It happens in small steps, not one big jump.
The tool tests scales like 90 percent, 80 percent, and lower, stopping at the first one that fits. Each step keeps as much size as possible.
A small scale step is usually invisible. A photo shown at 800 pixels wide looks identical at 720 pixels wide.
Scaling helps most with very large originals. A 4000-pixel-wide photo has far more pixels than any screen needs, so trimming it costs nothing visible.
You can lock the dimensions if a portal demands exact pixels. The tool will then work harder on quality alone, and may warn you if the target cannot be met.
Some targets cannot be hit. A 2KB target for a detailed photo is impossible, and the tool says so honestly instead of handing you a useless file.
Impossible targets usually come from a misunderstanding. A portal asking for 2MB may have been misread as 2KB, a thousand times smaller.
Fixed dimensions make targets harder. A large pixel size with a tiny file cap can be genuinely impossible, and no tool can fix that.
Lossless PNG makes it hardest of all. A detailed image locked to PNG may never fit a small target, no matter how much you shrink it.
When the tool reports a miss, change what you can control. Switch to JPG, allow scaling, or crop tighter, and run it again.
JPG is the safest format for custom targets. It is accepted everywhere and compresses photos efficiently at any size.
WebP often beats JPG slightly on quality. Use it when the destination accepts it and you need the sharpest result at a tight target.
PNG suits graphics, not photos. A logo or chart stays pixel-perfect in PNG, while a photo in PNG wastes the budget.
The auto-convert option helps here. When it is on, large PNG photos are converted to JPG or WebP automatically during compression.
Transparent images deserve a decision. Keep transparency with WebP when possible, or flatten to JPG on white when the destination demands it.
Batch mode compresses many images to the same custom target at once. Drop a folder in, type the target, and let it run.
Each image is searched individually. A simple portrait and a detailed landscape get different quality settings, even though they share a target.
The summary tracks partial success. If three files hit the target and one missed, the summary shows exactly which one needs attention.
Download the results as a ZIP file. The filenames mark the custom target, so the set stays organised.
Batch custom targets are ideal for portals with unusual caps. Fifty applicant photos all compressed to 80KB takes minutes, not hours.
Typing the wrong unit is the most common mistake. A target of 100MB instead of 100KB produces a file a thousand times too large.
Setting an impossible target wastes time. A 3KB target for a photo will always miss, and the tool will tell you so.
Forgetting to check the result is common too. The file size may be right while the image is blurry, so preview before you download.
Re-compressing an already compressed file adds damage. Always start from the original, even when the target is generous.
Finally, do not assume every portal accepts WebP. Check the accepted formats first, or you may compress twice.
All compression happens in your browser. Your photos are processed locally and never uploaded to a server.
That matters for custom targets, which often serve sensitive documents like contracts, medical scans, and client proofs.
Camera GPS tags and EXIF data are stripped during compression. The downloaded files carry no record of where or when they were taken.
For sensitive work, that privacy is a feature. You can compress a confidential batch without worrying about who else might see it.
Always double-check the downloaded files before sharing them. Privacy in processing does not replace care in distribution.
The most expensive mistake in custom compression is a unit error. Typing 100MB when you meant 100KB produces a target a thousand times too large.
Always read the portal limit twice. Note the number and the unit separately, then type them separately into the tool.
After typing, read the input back before uploading. A quick glance catches a missing decimal or an extra zero.
Remember that 1MB equals 1024KB, not 1000KB. The tool uses the binary definition, which matches how operating systems measure files.
If a result looks wildly wrong, check the unit first. Nine times out of ten, the unit is the problem, not the tool.
Email systems cap attachments, often at 20MB or 25MB per message. A set of images that must fit inside that cap benefits from custom targets.
Divide the cap by the number of images to find each file's budget. Ten images sharing a 20MB cap get 2MB each.
Use a slightly smaller target than the exact division. A safety margin covers rounding and keeps the total safely under the cap.
Compress the batch to the custom target and check the total size of the ZIP. If it exceeds the cap, lower the target and re-run.
For a single image, the cap rarely matters. One photo at 500KB sends easily, while one at 5MB may bounce.
Print shops sometimes state a maximum file size for uploads. A custom target hits that number exactly without guessing.
Remember that print needs resolution, not just file size. A 2MB file at low resolution still prints poorly, whatever the size.
Keep the dimensions high when preparing for print. Let the tool work on quality alone, and only allow scaling if the target demands it.
Check the printed proof when you can. A screen preview hides problems that paper reveals, especially banding in smooth areas.
For final print delivery, send the original when the shop accepts it. The custom target is for upload limits, not for the press itself.
Running the same image at several targets shows you where quality stops improving. Compress it to 100KB, 200KB, and 500KB and compare.
View all three at full size. The jump from 100KB to 200KB is usually visible, while the jump from 200KB to 500KB is often not.
That comparison tells you the smallest size that looks good. Using it saves bandwidth on every future image of the same kind.
Keep the comparison files for reference. They become your guide for choosing targets on similar images later.
Testing takes minutes and pays off for months. A tested target beats a guessed target every time.
Most people reuse the same few targets. A portal that wants 80KB this month will want 80KB next month too.
Keep a short list of your common targets with their purposes. A note like exam portal 80KB, blog hero 300KB saves re-reading rules.
Bookmark the tool with the target in mind. The tool remembers nothing between visits, so your list is the memory.
Share the list with your team. A shared list of targets stops every person from guessing differently.
Review the list when rules change. Portals update their caps, and an old target can become a rejected upload.
A compressed image still needs to serve every viewer. A tight custom target that blurs text fails readers who need that text.
Check contrast and readability after compression. Text overlays and small labels must stay legible at the target you chose.
Always add alt text to images compressed for the web. A small file with good alt text serves more people than a perfect file with none.
When text matters, prefer a larger target. The extra kilobytes protect readability, which is worth more than a smaller file.
Compression and accessibility go together. A clear, high-contrast source compresses better and is easier for every viewer to read.
For the hands-on steps, read How to Compress an Image to an Exact KB Size. For the deep dive on the search itself, see Exact KB Targets: Binary Quality Search Explained. If a fixed size suits you, the 100KB compressor and 200KB compressor cover the common caps.
Step-by-step: compress any image to an exact KB size for unusual portal caps. Type the number, run the search, and verify the result.
How the binary quality search finds the sharpest image at any exact KB size: the algorithm, the steps, scaling, and its limits.
Compare animated GIF, WebP, and MP4: file size, quality, compatibility, and when to use each format for animations on the web.
Step-by-step: compress any animated GIF for Discord, Slack, websites, and chat. Presets, palette, scale, and fixes for stubborn files.