UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

Compress Image to Target Size

Compress an image to an exact KB target — 20, 50, 100, 200, 500 KB or custom. Smart binary-search quality.

About Compress Image to Target Size

Most online forms have a hard limit on image size: passport offices want under 200 KB, government portals cap at 100 KB, school applications sometimes ask for 50 KB. Manually finding the right quality is frustrating — drop too low and the photo looks bad, drop too little and you're over the cap. This tool runs a binary search over JPG quality to find the highest-quality encoding that fits under your target. If even quality 5% can't reach the target (extremely detailed photos, very small targets), the tool transparently downscales the image and retries. The result hits within a few percent of your target every time. Picks WebP or JPG output, supports a custom background colour for transparent PNGs, and runs entirely in your browser. Perfect for passport photos, ID applications, school portals, and any size-capped image upload form.

Why use Compress Image to Target Size

  • Hits target file size exactly — uses binary search over quality to find the highest quality encoding that fits under your target, getting within a few percent of the cap every time.
  • Smart fallback to downscaling — if even minimum quality can't reach a very small target, the tool downscales the image and retries automatically, never returning an oversized file.
  • Preset KB targets cover the common form requirements — 20 KB for tiny avatars, 100 KB for government portals, 200 KB for passport applications, 500 KB for general web upload forms.
  • Custom KB input for precise requirements — type any value from 5 KB to 10000 KB. Perfect when a form specifies an unusual cap like 73 KB or 350 KB.
  • 100% private — files never leave your browser. Sensitive ID photos, passport scans, and personal documents stay on your device throughout the encoding loop.
  • Choose JPG or WebP output — JPG for universal compatibility with old forms, WebP for smaller files when the destination is modern and accepts it.

How to use Compress Image to Target Size

  1. Drop a .jpg, .png, or .webp file onto the upload zone — single file at a time.
  2. Pick a target size from the presets (20, 50, 100, 200, 500 KB or 1 MB) or type a custom value in the KB input.
  3. Choose output format: JPG (best for photos) or WebP (smaller files, modern format) — pick the one your destination form accepts.
  4. If your source has transparency, pick a background colour to fill — JPG cannot store alpha and uncovered areas would otherwise become black or grey.
  5. Click Compress to target size — the tool runs a binary search over quality and falls back to downscaling if quality alone can't reach the target.
  6. Compare the original and compressed sizes alongside the actual hit percentage of the target, then download the optimised file.

When to use Compress Image to Target Size

  • Submitting a passport, visa, or government ID photo where the upload form has a strict file-size limit like 100 KB or 200 KB.
  • Uploading a photo to a school admission portal, scholarship application, or university form that specifies a maximum image size in KB.
  • Attaching photos to a job application, online resume builder, or recruitment portal that caps each image at 50 KB or 100 KB.
  • Posting to a forum, classified ad site, or marketplace listing that has a per-image size limit and rejects oversized uploads.
  • Reducing image weight for embedding in PDF documents where smaller images keep the final PDF under email-attachment size limits.
  • Optimising profile pictures and avatars for old social media or community platforms where file-size caps are tight (Discord, IRC, vBulletin forums).

Examples

Passport photo to 100 KB

Input: passport.jpg: 1200×1600, 480 KB

Output: passport_100kb.jpg: 1200×1600, 96 KB at quality 73

Tiny avatar to 20 KB

Input: avatar.png: 800×800 with alpha, 240 KB

Output: avatar_20kb.jpg: 800×800 white background, 19 KB at quality 60

Photo to 500 KB

Input: photo.png: 4032×3024, 5.2 MB

Output: photo_500kb.jpg: 4032×3024, 488 KB at quality 84

Tips

  • Target slightly under the form's actual cap — if the form says 100 KB max, target 90 KB to leave a small buffer for any platform-side metadata additions.
  • Use JPG output for almost all upload forms — government and school portals often whitelist JPG only and reject WebP outright as an unrecognised format.
  • If your source is a screenshot with text, the binary search may produce a noticeably blurry result at very small targets — text suffers worst from JPG compression. Consider cropping non-essential areas first.
  • For transparent PNG sources, pick the background colour that matches the destination surface — white for documents, your form's background colour, or your brand colour.
  • If the binary search has to downscale, the warning will tell you. Larger targets keep original dimensions; very small targets (e.g. 20 KB on a 4K photo) require both downscaling and quality drops.

Frequently Asked Questions

Does my image leave my browser?
No. Compression runs entirely inside your browser tab using the Canvas API. Your photos are encoded and re-encoded locally during the binary search — nothing is uploaded to UtilityKit's servers or any third-party service.
What's the size limit?
Source files are accepted up to 50 MB. The actual practical limit is your browser's memory — most browsers handle photos up to 100 MP (10000×10000 pixels) without issue. Very large source files mean slower binary-search loops.
How accurate is the target hit?
The binary search converges within 10 iterations to a file that fits under your target, typically within 5-10% under the target value. If your target is 100 KB, expect the output to be 90-99 KB, never over 100 KB.
What if my image can't compress that small?
When even minimum quality can't reach the target, the tool automatically downscales the image (reduces pixel dimensions) and retries. If the target is impossibly small (e.g. 5 KB on a 4K photo), the output will be a downscaled, low-quality version. Use a larger target for better results.
Why pick JPG vs WebP?
JPG is older and universally supported — every government form, ID portal, and ecommerce site reads JPG. WebP is 25-35% smaller at the same quality but some legacy upload forms reject it as an unrecognised format. When in doubt, pick JPG.
Does this work on transparent PNGs?
Yes. Pick a background colour and the tool composites the PNG over that colour before encoding to JPG. WebP keeps the alpha channel during compression, so background colour is irrelevant if you pick WebP output.
Will quality look bad at small targets?
At very small targets (under 50 KB on a high-resolution photo), JPG compression artefacts become visible — blocky regions, ringing around edges, blurry details. Targets of 100 KB or higher on photos typically look fine even on retina displays.
Can I batch process multiple images?
This tool processes one image at a time to keep the binary search predictable and the UI clear. For batch compression, use bulk-image-batch or the standard image-compress tool which accept multiple files at once.

Explore the category

Glossary

Binary search
A divide-and-conquer search algorithm. The tool tries quality 50, sees if the file fits, then halves the search range upward or downward until it converges on the highest quality that fits the target.
Quality (1-100)
JPG and WebP encoder quality parameter. 100 is the highest fidelity (largest file), 1 is the lowest fidelity (smallest file). The binary search finds the highest quality value that fits your target.
Target file size
The maximum byte size you want the output file to be under, expressed in kilobytes. Government forms commonly specify 100 KB, 200 KB, or 500 KB targets that this tool can hit precisely.
Auto downscale
When even minimum quality can't reach the target, the tool reduces the pixel dimensions by 15% and tries again. This continues until either the target is reached or the image becomes unusably small.
JPG vs WebP
JPG is older and universally supported; WebP is newer and 25-35% smaller at the same quality. Pick JPG for old upload forms, WebP for modern destinations that accept it.
Background composite
When a transparent PNG is encoded as JPG, the alpha pixels must be replaced with a solid colour. The tool composites the PNG over your chosen background hex before the encode.