Compress Image to a Target File Size
Compress a JPEG or PNG to an exact file size in KB. Automatically finds the right quality — and resizes if needed. Free, private, browser-only.
Hit an Exact File Size, Not Just a Quality Setting
Enter the file size you need in KB and this tool searches for the highest quality that fits — binary-searching JPEG or WebP quality first, and only shrinking the image's dimensions if quality alone can't get small enough. Useful for upload limits (passport photos, job applications, forms) that specify an exact maximum size rather than a quality level.
How it decides quality vs. resizing
| Step | What happens |
|---|---|
| 1 | Try every quality level at full resolution first |
| 2 | If even quality 1 is still too big, shrink the image and retry |
| 3 | Repeat at smaller sizes until the target is met |
Need a specific common target? Try 100KB, 50KB, or 20KB presets, or enter any size above.
Frequently asked questions
How does this find the right quality?
It binary-searches the quality setting — encoding at a middle value, checking the resulting size, and narrowing in — until it finds the highest quality that still fits under your target.
Will it always hit my exact target?
It gets under your target whenever physically possible for that image. If even the lowest quality and smallest usable size are still too big, it returns the closest result it could reach and flags that the exact target wasn’t met.
Does it resize my image?
Only if quality alone can’t reach your target — it tries every quality level at full resolution first, and only shrinks dimensions as a second step.
JPEG or WebP — which should I pick?
WebP usually keeps more visible quality at the same target size. Pick JPEG only if you need maximum compatibility with older software.
Can I process multiple images at once?
Yes — drop up to 20 images and each is searched for your target size individually, then download them together as a ZIP.
Is my image uploaded anywhere?
No — the whole search runs locally in your browser using WebAssembly.
What if my target size is impossibly small?
The tool won’t shrink an image into an unusably tiny handful of pixels chasing an unreachable target — it stops at a sensible minimum size and returns its closest attempt.
Can I upload a PNG and get a small target size?
Yes — PNG input is decoded and re-encoded as JPEG or WebP for the search, since PNG’s lossless compression can’t reliably hit an arbitrary small target the way a quality-based format can.