🔒 100% private — no uploads

Compress Image to a Target Size

Shrink JPG, PNG and WebP images to a specific file size in kilobytes. Set your target, compress, and download — all privately in your browser.

Click to choose images or drag & drop here JPG, PNG, WebP · select multiple files

Compression runs in your browser — your files are never uploaded.

Advertisement

How it works

Image file size is mostly determined by the encoder's quality setting and the pixel dimensions. This compressor loads your picture and re-encodes it with advanced codecs compiled to WebAssembly: MozJPEG for JPEG output, which packs more detail into fewer bytes than a browser's built-in encoder at the same quality, and OxiPNG for lossless PNG output, which strips waste without altering any pixel. A binary search on quality homes in on the highest setting whose JPEG or WebP output still fits under your KB target; if even maximum compression is too big, the image is downscaled in steps until it fits. Should a codec be unavailable, the tool falls back to the browser's canvas.toBlob() encoder. All of this runs locally in a background worker, so your files are never uploaded.

How to compress an image to a target size

  1. Drop one or more images into the box above.
  2. Type your desired size in kilobytes (100 KB is a common requirement).
  3. Pick an output format — JPEG for photos, WebP for the smallest files.
  4. Click Compress images and let the search run.
  5. Check the resulting size, then download each compressed file.

Why use this compressor

Plenty of websites and application forms reject photos above a strict size limit, and oversized images slow down web pages and bloat email. Reaching an exact KB target by hand means exporting, checking the size, tweaking quality, and repeating. This tool automates that loop and finds the best quality that fits, usually in a moment for an everyday photo. Because it works in your browser — offline after the first visit — it is private enough for passport scans, signatures and other documents you would never want to hand to a random server.

Need a quick preset? Jump to 50 KB, 100 KB or 200 KB, each preconfigured for a common requirement, and switch formats or fine-tune the target here for everything else. For the full method, read how to compress to an exact file size.

Related tools

Frequently asked questions

How does compressing to a target size work?

For JPEG and WebP the tool re-encodes your image at progressively lower quality, and downscales it if needed, searching for the highest quality that still fits under your chosen KB target. JPEG output uses the advanced MozJPEG encoder, which produces smaller files than the browser at the same quality. It uses a binary search so it converges in just a few tries.

Will the image lose quality?

JPEG and WebP are lossy formats, so reducing file size trades away some detail. For most photos a target of 100–300 KB looks great on screen. Aggressive targets on large images may soften fine detail, which is normal.

Are my files uploaded anywhere?

No. Compression runs entirely in your browser — using the MozJPEG and OxiPNG codecs compiled to WebAssembly, with the Canvas API as a fallback. Your images never leave your device, so even sensitive documents and ID photos stay private.

What target size should I pick?

Many web forms and government portals require under 100 KB or 200 KB. For email attachments 300–500 KB is usually fine. For website hero images, aim for 150–250 KB to keep pages fast.

Can I compress PNG images too?

Yes, two ways. For photos, re-encode to JPEG or WebP to hit a small KB target, since those formats compress photographic content far more efficiently. To keep PNG and its transparency, choose the PNG (lossless) option: OxiPNG shrinks the file without changing a single pixel, then downscales if a tighter target is requested. Because PNG is lossless it cannot be squeezed to an arbitrary KB by quality alone.

Why is my result slightly above the target?

When even the lowest practical quality and a downscaled image cannot reach the target, the tool returns the smallest version it produced rather than destroying the picture. Lower the target or reduce the dimensions for a smaller file.

Image Tools compresses images entirely within your browser. Files are never uploaded.