Optimize
HEIC to Target Size
Need a photo under a limit like 200 KB? Enter the target and the tool finds the highest JPG or WebP quality that fits, or says it cannot.
Input
Drop HEIC or HEIF files here
or choose them from your device
HEIC or HEIF · up to 100 MB per file · processed on your device
At a glance
- Input
- One HEIC/HEIF photo per run
- Output
- JPG or WebP, never HEIC
- Search
- Quality 20–95, up to 7 trial encodes
- Target
- Kilobytes (1 KB = 1024 bytes)
What this tool does
Enter a size in kilobytes, such as 200, and this tool searches for the highest JPG or WebP quality whose file stays at or under that size. It tries a middle quality, then narrows up or down, for up to seven trial encodes between quality 20 and 95. The report names the quality it chose and the real size, with a "Target met" badge. It is for upload forms and ticketing systems with a hard byte limit, where guessing a quality slider takes several tries.
Two honest points about the result. First, a binary search with seven probes lands at or below your target, not exactly on it: for a 200 KB target on a 2048 px WebP of a 12 MP test photo, it settled on quality 75 and a 182.3 KB file. Second, some targets cannot be reached. If even quality 20 is too large, the badge turns to "Smallest possible" and you get the smallest file the tool could make, for instance 239.2 KB as JPG, or 321.8 KB as WebP, from the same photo at full size when asked for 80 KB. The fix is the "Maximum dimensions" menu (2048, 1600, 1280 or 800 px), which cuts pixels before the search, and which does far more for a tight target than quality alone.
Each trial encode keeps its file, so the one you download is the one that was measured, not a second encode. Encoding runs in a worker (OffscreenCanvas) where the browser supports it, with a main-thread fallback, and the progress line reads "Trying quality N". Photos are converted to sRGB. There is no wide-colour option on this page; the compressor has one.
How to use it
- 01
Choose one HEIC file
Each run handles a single photo, because the search is run per image.
- 02
Type the target in KB
The box starts at 200. The value is converted at 1024 bytes per KB, so 200 means 204,800 bytes.
- 03
Pick WebP or JPG
WebP often fits better quality into the same budget. Choose JPG when the form or system you are uploading to may not accept WebP, and try both for a very tight target.
- 04
Add a dimension cap for tight targets
If you are asking for a few tens of KB from a large photo, set 1600 or 1280 px rather than leaving the original size.
- 05
Press Compress to target
Watch the "Trying quality" progress. The badge then reads Target met or Smallest possible, with the quality and the size reached.
- 06
Download, or retry with a smaller cap
If you got Smallest possible, press Optimize another file, add the same photo again, and pick a lower dimension cap.
When to use it
Government and university upload portals
Many cap uploads at a size stated on the form. Enter that number, add a 1600 px cap if the photo is large, and the tool finds the quality that fits.
Ticketing and support systems
When an attachment limit is stated in KB, setting the exact figure avoids a rejected upload and a second try.
A large photo in an email
When one large photo has to ride along in a message, a target of 500 KB gives a predictable result without manual trial and error.
Checking whether a photo can reach a size at all
The Smallest possible result tells you how far a given photo is from the target at full size, which tells you how much to cut dimensions.
Good to know
- 01One photo per run. For many photos with the same cap and a quality of your choosing, use the compressor.
- 02The output is JPG or WebP, never HEIC. The HEIC encoder in the browser has no quality setting, so it cannot be steered to a size.
- 03The result is at or under the target, not on it. The search has seven steps, so it can leave some headroom: 182.3 KB for a 200 KB target in my test.
- 04Very small targets are often unreachable at full dimensions. In my test, 80 KB and 5 KB were both reported as Smallest possible for a 12 MP photo, and only a dimension cap closes that gap.
- 05Browsers use their own encoders, so the same quality setting can give a slightly different size elsewhere. If a limit is razor-thin, leave a margin.
- 06EXIF, GPS and XMP are not carried into the output.
Technical notes
Privacy and limits
Your file stays on your device
This tool runs in your browser with WebAssembly. The file is read into the tab, processed there and discarded when you close it — there is no upload and no account. You can check this yourself in your browser's network panel, and the privacy page lists what analytics does and does not receive.
Limits and checks
Up to 100 MB and 100 megapixels per file; batches of up to 50 files and 500 MB. Files are treated as untrusted input and every output is re-opened and validated before it is offered — see how we handle untrusted files.
Frequently asked questions
Related tools and reading
Further reading
Last updated: . Something wrong or out of date? Tell us — corrections are recorded in the changelog.