How to Compress an Image to a Target File Size (KB)
Hit email limits, form uploads, or API caps using Compress Image Target size mode—automatic quality search for JPEG and WebP in your browser.
In short
Enter a KB budget under Target size; the tool searches quality for you and reports when the goal cannot be reached.
To compress to a specific file size, use Compress Image Target size mode with JPEG or WebP output, set optional Resize if the source is oversized, enter your KB target, and read the stats line to see whether the goal was met—then lower dimensions or accept a slightly larger file if the codec cannot go smaller.
Why KB targets fail on huge originals
Quality search can only shrink what the encoder sees. A 6000px phone photo carries far more entropy than a 1200px derivative, so the same KB cap may be unreachable at full resolution even at minimum quality. Cap longest edge first, then set Target size.
WebP often reaches tighter KB than JPEG at similar visual quality, which matters when portals measure bytes, not aesthetics.
When to raise the cap instead of crushing quality
If the stats line says the target could not be reached and the compare slider already shows banding, lowering KB further is the wrong lever. Resize harder or accept a slightly larger file—platform limits are negotiable; destroyed product detail is not.
Real-world examples
Example: 500 KB form cap on a phone photo
Source: 3024×4032 HEIC, 2.8 MB. Requirement: under 500 KB for a job application portal.
Settings: Target size 480 KB, WebP output, max edge 1920 px. Result: ~465 KB with Target met; compare slider checked shirt collar edges before submit.
If Target could not be met at 1920 px, next step is max edge 1280 px—not dropping to Smallest file blindly when a face photo must stay clean.
Why this works
- Binary search on quality is faster and more accurate than guessing slider values by hand.
- Resizing first removes pixels that block aggressive byte targets on photo originals.
- On-device processing keeps sensitive uploads off third-party servers.
When to use this workflow
- An upload form lists a maximum KB per image.
- Email gateways reject attachments above a fixed size.
- You need predictable bytes for APIs, LMS platforms, or marketplaces.
- You already know the cap but not which quality slider value hits it.
Step-by-step guide
- Open Compress Image and upload the file (HEIC and other formats decode locally).
- Choose WebP or JPEG as output—Target size does not apply to PNG.
- Set optional Resize when the source is much larger than delivery (for example max edge 1920 px).
- Select Target size under What matters most? and enter your KB goal.
- Check the Target stat (met or could not reach) and the compare slider; adjust KB, resize, or format if needed, then download.
Common mistakes to avoid
- Expecting PNG Target size—switch to WebP or JPEG for KB-driven goals.
- Setting an impossible KB on a huge uncompressed original without resizing first.
- Ignoring the “couldn't reach” warning and assuming the platform will accept the file.
Frequently asked questions
What if Target size cannot hit my KB?
The tool shows when the goal was not reachable. Try a lower max edge, switch to WebP, or raise the KB slightly. Already-optimized tiny files have little room left.
Is Target size the same as Smallest file?
No. Smallest file maximizes savings with a fixed strong preset. Target size stops near the KB you specify, which may keep more detail when the cap allows it.
