🗜️ Image Compressor

An image compressor for JPG, PNG and WebP to an exact file size or by quality. Runs in your browser — nothing is uploaded. Batch, EXIF removed.

✓ Free✓ No Signup Required✓ Browser-Based
🗜️

Choose images, or drop them here

JPG, PNG, WebP, GIF, BMP. They are compressed in this tab and never uploaded.

The quality is found by encoding and measuring, not estimated, so the result lands at or just under the number you set.

What Image Compressor Does

Image compression trades detail you are unlikely to notice for bytes you certainly will. JPEG and WebP do this by discarding high-frequency information the eye resolves poorly — fine texture, subtle gradients in flat areas — and the "quality" number you set is really a knob on how much gets thrown away. PNG works the opposite way: it keeps every pixel exactly and finds its savings in repetition, which is why it excels on screenshots and logos and struggles on photographs.

The thing most compressors get wrong is that people rarely want a quality number. They want a file under a limit: a portal that rejects anything over 200 KB, an application form capped at 100 KB, an email that will not send. Quality does not map to file size in any predictable way — the same setting produces wildly different sizes for a blue sky and a crowd scene — so a slider can never answer "will this clear the limit?" in advance.

This tool answers it by measuring. It encodes the image, checks the actual byte count, and adjusts, narrowing the quality range by half each pass until the result sits at or just under your target. When even the lowest usable quality overshoots, it starts reducing resolution instead, because past a certain point fewer well-encoded pixels look better than more badly-encoded ones.

The whole thing runs in your browser. Nothing is uploaded, which also means the output carries no EXIF: re-encoding through a canvas produces a file of pure pixels, so the camera model, timestamp and the GPS coordinates a phone writes into every photo do not survive the trip.

How to Use Image Compressor

  1. Add one or more images, or drop them onto the box
  2. Pick "to a target size" and type the limit in KB, or switch to quality and set a number
  3. Choose an output format, or keep the original
  4. Compress, check the before-and-after sizes, and save

Formula Used by Image Compressor

Finding the quality that hits a target size

binary search on q ∈ [0.30, 0.95]: encode(q), measure bytes, keep the highest q whose output ≤ target

q
JPEG or WebP quality passed to the encoder, 0 to 1
target
the byte limit you set, e.g. 200 KB = 204,800 bytes
0.30
the practical floor — below it a JPEG stops shrinking meaningfully and starts visibly breaking up

Worked example

A 3.4 MB photo, target 200 KB. Nine passes of the search.

  1. Encode at q = 0.30 first. If even that overshoots the target, no quality on this image can reach it, so drop the resolution and start again.
  2. It fits, so search upward: try the midpoint of [0.30, 0.95] — q = 0.625.
  3. Too big → the answer is below 0.625; try the midpoint of [0.30, 0.625].
  4. Small enough → the answer is at least that; search the upper half.
  5. Each pass halves the remaining interval: after nine, the range is 0.65 ÷ 2⁹ ≈ 0.0013 wide.

Result: The highest quality whose encoded output is ≤ 200 KB, pinned to about one part in a thousand — nine encodes, not a guess.

Which format to compress to

The choice matters more than the quality setting. A photograph forced into PNG, or a screenshot forced into JPG, loses more than any slider recovers.

FormatCompressionTransparencyBest forAvoid for
JPGLossyNoPhotographs, scans, anything with continuous toneLogos, screenshots, text, line art
PNGLosslessYesScreenshots, logos, flat color, sharp edgesPhotographs — files run several times larger
WebPBothYesAlmost everything on the web; 25–34% below JPEG at equal SSIMWorkflows that must open in very old software
GIFLossless, 256 colorsYes, 1-bitShort animation onlyAny still image — WebP or PNG beats it comprehensively

Source: Google — WebP Compression Study

Common size limits worth compressing to

Where the target-size mode earns its keep. Check the exact limit at the source — portals change theirs without notice.

WhereTypical limitSensible target
Gmail attachment25 MB per messageWell under; larger files are replaced with a Drive link
Government and job portalsOften 100–500 KB per imageSet the exact number the form states
A web page hero imageNo hard limit; page weight is the constraint150–300 KB at the size it is displayed
A blog body imageNo hard limit60–150 KB is usually indistinguishable from more

Source: Google — Gmail attachment size limits

How to Read Your Result

Quality 75 to 85 is the useful range

Above 90 you are spending bytes on differences almost nobody can see; below about 60 the blocky artefacts around edges and in gradients become obvious. If a target-size run reports a quality below 50, the target is probably too tight for the image and you would get a better-looking result by reducing the resolution deliberately.

A result larger than the original is real, not a bug

It happens with PNG. This tool re-encodes through the browser rather than running a dedicated PNG optimizer, so a PNG that has already been through pngquant or oxipng can come out larger. The row says so rather than hiding it behind a clamped "0% saved". For those files, convert to WebP instead — it keeps transparency and is genuinely smaller.

Compressing twice compounds the loss

Every lossy save discards more, and the losses do not cancel out. Compress once from the original whenever you can. If you are editing, keep a lossless master and compress only the final export.

Limitations & Accuracy Notes

  • PNG output is a browser re-encode, not a dedicated optimizer. It will not match pngquant or oxipng, and on an already-optimized PNG it can be larger.
  • EXIF, ICC color profiles and GPS data do not survive. That is usually welcome, but if you need the camera metadata kept, use a tool that preserves it.
  • A wide-gamut photo tagged with a Display P3 profile loses that tag and is treated as sRGB, which can shift saturated colors slightly.
  • Very large images are held in memory while they are processed, so a phone with little free RAM may fail on a 50-megapixel file where a laptop will not.
  • Animated GIFs and animated WebP are flattened to their first frame — this compresses still images only.

Frequently Asked Questions

How do I compress an image to exactly 100 KB?
Choose "To a target size", type 100, and add the image. The tool encodes the picture, measures the result, and adjusts the quality up or down until the file lands at or just under 100 KB. That measure-and-adjust loop is the only reliable way to hit a size: the relationship between a quality number and the resulting bytes is different for every image, so a quality slider can never tell you in advance whether you have cleared a limit.
Are my images uploaded anywhere?
No. The compression runs in your browser using the canvas API, and this site has no server that could receive a file. You can confirm it by opening your browser’s network panel while compressing, or by disconnecting from the internet after the page has loaded — the tool keeps working.
Does compressing an image lose quality?
JPG and WebP compression is lossy, so yes — detail is discarded permanently. At quality 75 to 85 the loss is invisible at normal viewing distance for most photographs, which is why that is the range worth using. PNG is lossless: the file gets smaller with no change to a single pixel, but the reduction is far more modest and only resolution can shrink it further.
Why did my transparent PNG come out with a white background?
Because it was saved as JPG, and JPG has no alpha channel at all. Anything transparent has to become some color, and unfilled it would come out black, so white is painted in first. Choose PNG or WebP as the output format to keep transparency.
Does this remove EXIF and GPS data from my photos?
Yes, as a side effect rather than an option. Re-encoding through a canvas produces a fresh file containing only pixels, so the camera model, timestamp, lens settings and the GPS coordinates a phone writes into a photo are all gone from the output. If you need the EXIF kept, this is the wrong tool.
Can I compress several images at once?
Yes. Add as many as you like, set one target or quality, and compress them together; each row shows its own before and after size. "Save all" downloads them one after another with a short gap, because browsers block a burst of simultaneous downloads.
Why can my image not reach the size I asked for?
Because there is a floor. Below roughly quality 30 a JPEG stops getting meaningfully smaller and starts falling apart, so past that point the tool reduces resolution instead. If even a heavy downscale cannot reach the target, it hands back the smallest version it managed and says so — for a very tight limit on a very large picture, cropping is usually the better answer.

References & Further Reading

By OnlineToolHubs Team • September 2026