Compress to Target Size

Enter a target file size in KB or MB and the tool binary-searches the JPEG/WebP/AVIF quality to produce the highest-quality image that stays under your limit. In-browser, zero upload.

How to use

Purpose

Precision compress-to-target-size tool — set an exact output size limit (e.g. ≤200KB, ≤500KB, ≤1MB) and the algorithm binary-searches the optimal JPEG quality to fit, maximizing visual quality under the constraint. Essential for government portal uploads, exam registrations, social platforms, and email attachments with strict size limits. All in-browser.

Steps

  1. Upload an image
  2. Enter target size (e.g. 200 / 500 / 1024 KB)
  3. Pick output format (JPEG = most compatible)
  4. Algorithm binary-searches from quality 95 downward to find the highest quality fitting the size limit
  5. Review result: actual size + achieved quality + comparison
  6. Download

FAQ

Common government / exam upload limits?
China: 学信网 ≤10KB or ≤100KB; civil-service exams ≤60-200KB. US passport: 240KB. UK / Schengen visa: varies. Always check the specific portal's size requirement.
Will quality be terrible at tiny target sizes?
Depends on target size + image complexity. Simple ID photos at 30KB still look clean; photographic content at 100KB may show JPEG blocking. For very small targets, first downsize via the resize tool — fewer pixels need fewer bytes.
Can I keep both small size and high quality?
Inherently a trade-off. To do better, switch output to WebP / AVIF (same quality, smaller file than JPEG).
Why isn't the result exactly the target?
JPEG quality / size relationship is nonlinear. Algorithm finds the highest quality that fits ≤ target, so actual size will be slightly below target.
Privacy?
All compression in-browser — your photo isn't uploaded.

Use cases

  • Government portal upload ≤200KB
  • Civil-service / graduate exam ≤60KB ID photo
  • Social security / public service photo requirements
  • Email attachment per-image ≤1MB
  • Visa application photo size compliance

Use cases

Government / exam / visa upload size limits — binary-search optimal quality. For sub-50KB targets, downsize pixels first via resize.