Pick a target size and get the highest quality that fits under it
The Image Compressor re-saves JPG, PNG and WebP images in their own format to make the file smaller. You choose a target file size, and the tool finds the highest quality that stays within it. If quality alone is not enough, it shrinks the width and height too. For example, the sample photo (2,400 × 1,597 JPG, 332 KB) lands at quality 76 and 199 KB with a 200 KB target, and its pixel size stays the same.
The quality-to-size curve is the size of your photo actually saved at each quality, so you can see at a glance how much each step down saves. The original and the result are shown side by side at the same spot and the same zoom, so you can check the picture before saving. Your images are never sent to a server; everything happens inside this browser.
When to use it
- Submitting a photo to a site with a file size limit: the U.S. Department of State's online passport renewal photo upload says "The file size should be between 54 KB and 10 MB." A limit like that has a lower bound too, so pick a target that does not squeeze the file below it.
- Attaching several photos to an email, chat or forum post: a phone photo is often several MB, which uses up an attachment limit quickly. You can shrink many photos to the same target and download them as one ZIP.
- A blog or shop page loads slowly: Chrome's Lighthouse audit "Efficiently encode images" lists images that could be compressed further, with the savings, and says that smaller images make the page load faster and use less data.
- A screenshot or logo PNG is heavy: PNG has no quality setting, so it cannot be shrunk like a photo. This tool reduces the number of colors and keeps the transparent background. The sample transparent graphic went from 71 KB to 32 KB with 256 colors.
- Sending a photo without its location: a re-saved file no longer carries Exif data such as the GPS location, the date taken and the camera model.
How to use it
- Drop the images onto the workspace or press “Choose images”. A screenshot can be pasted with Ctrl+V. You can add up to 50 images at a time, 50 MB each.
- Choose a target size. Pick one of the 100 KB to 2 MB buttons or type a number under “Custom”. To shrink without a target, choose “No target” and click the curve or use the arrow keys to pick a quality (the default is quality 80, or 256 colors for PNG).
- If needed, change the save format (Original, JPG, PNG, WebP) and the longest side (2,560 to 800 px). If the pixel size must not change, turn on “Keep pixel size (quality only)”.
- In the comparison pane, “Fit” shows the whole picture, and 100% and 200% show actual pixels. Click the photo to zoom that spot to 100%, and drag to move both panes together. “Show diff” paints the pixels that changed from yellow to red.
- Press “Save this image” or “Save N as ZIP”. The size is added to the end of the file name (for example photo-199kb.jpg).
How the target size is met
- If the original is already within the target and the format and size are not changed, it is returned as is without re-saving. Saving it again would only cost quality.
- At the current size, the tool looks for the highest quality between 95 and 50. It saves at the middle quality, then searches the lower half if the file is over the target and the upper half if it is not, so it settles after 6 or 7 saves. Only sizes measured from real saves are used, so the result is always within the target.
- If even quality 50 is over the target, the tool keeps quality 50 and shrinks the longest side, looking for the largest size that fits.
- With “Keep pixel size (quality only)” on, the size is never touched and quality goes all the way down to 1. If it is still over the target, the image is marked “Over target”.
- For PNG, the number of colors plays the part of quality. It goes from 256 down to 64 colors, then the size is reduced; with the size kept, it goes down to 2 colors.
Below is the sample photo (2,400 × 1,597, 332 KB) fitted to each target.
| Target | Result size | Quality | Width × height | How it was met |
|---|---|---|---|---|
| 500 KB | 332 KB | — | 2,400 × 1,597 | Already within target, original kept |
| 300 KB | 294 KB | 85 | 2,400 × 1,597 | Quality lowered only |
| 200 KB | 199 KB | 76 | 2,400 × 1,597 | Quality lowered only |
| 100 KB | 100 KB | 50 | 1,996 × 1,328 | Quality 50 was not enough, so the size was reduced |
| 100 KB · pixel size kept | 98 KB | 27 | 2,400 × 1,597 | Quality lowered only |
| 50 KB | 50 KB | 50 | 1,273 × 847 | Quality 50 was not enough, so the size was reduced |
There is a reason to stop at quality 50. The libjpeg-family encoders that browsers use apply the standard JPEG default quantization table unchanged at quality 50, and below 50 they multiply the table by (5000 ÷ quality)%. At quality 25 that is 200%, double the table, and at 10 it is 500%, five times larger, so the 8 × 8 block pattern shows up easily. That is why the tool shrinks the size before going lower. The cutoff of 50 is this tool's own choice, though, so judge the picture in the comparison pane yourself.
Reading the quality → size curve
Each point on the curve is the size of your photo actually saved at that quality. The vertical axis is logarithmic, so the gap between 50 KB and 100 KB is as tall as the gap between 500 KB and 1 MB. The gray dashed line is the original size, the red dashed line is the target, the large dot is the result you will save, and the area above the target is shaded red to mark where the file is too big. The points for the sample photo are below.
| Quality | Saved size | vs. original |
|---|---|---|
| 100 | 986 KB | +197.1% |
| 95 | 393 KB | +18.3% |
| 90 | 332 KB | 0.0% |
| 80 | 246 KB | −26.0% |
| 70 | 187 KB | −43.9% |
| 60 | 161 KB | −51.5% |
| 50 | 141 KB | −57.7% |
| 40 | 124 KB | −62.9% |
| 30 | 106 KB | −68.3% |
| 20 | 82 KB | −75.4% |
| 10 | 54 KB | −83.9% |
- Quality 100 is larger than the original: re-saving a photo that is already compressed as JPG at the highest quality gives 986 KB, about 3 times the original. The lost detail does not come back, and the file only gets bigger.
- The biggest savings are between 90 and 70: for this photo, going from quality 90 to 70 takes it from 332 KB to 187 KB, 43.9% smaller.
- Below 50 the savings are small: going from 50 to 30 only changes 141 KB to 106 KB. The picture gets worse quickly while the file barely shrinks, so for a very small target it is better to reduce the size.
The shape of the curve differs from photo to photo. A photo with large smooth areas, such as sky or walls, shrinks well even at low quality, while one full of fine texture, such as leaves or sand, stays large at the same quality. That is why reading your own photo's curve is more reliable than relying on a fixed quality number.
PNG gets lighter with fewer colors
A browser canvas always saves PNG as lossless 32-bit and takes no quality value. The HTML standard also says the quality argument only applies to formats that have a quality setting, such as JPEG. So this tool writes PNG itself using the palette method of the PNG standard (color type 3). It lists 1 to 256 colors in the palette (PLTE), stores only a color number for each pixel, and records transparency separately for each palette entry (tRNS). That is why the transparent background survives.
The 256 colors are chosen like this. Median cut (Heckbert 1982) splits the colors into boxes of similar colors to pick the palette, and one more pass groups each color with its nearest palette color and refines the average. Then Floyd–Steinberg error diffusion spreads the color difference of each pixel onto its neighbors, so gradients show fewer bands. Screenshots and icons that already use 256 colors or fewer keep those colors exactly in the palette, so nothing is lost.
| Colors | Saved size | vs. original | Colors actually used |
|---|---|---|---|
| Lossless re-save | 117 KB | +66.4% | — |
| 256 | 32 KB | −55.1% | 245 |
| 128 | 28 KB | −61.1% | 126 |
| 64 | 24 KB | −66.8% | 64 |
| 32 | 21 KB | −70.9% | 32 |
| 16 | 19 KB | −73.9% | 16 |
| 8 | 18 KB | −75.5% | 8 |
| 4 | 11 KB | −85.5% | 4 |
| 2 | 2 KB | −97.6% | 2 |
These values were measured on the sample transparent graphic (1,200 × 900, 71 KB). A lossless re-save actually makes it bigger, because the browser's PNG saving compresses less than the program that made the original. Where the last column is lower than the row's color count, the picture simply needed that few colors. For graphics with shadows or gradients, stripes and speckles tend to appear below about 64 colors, so zoom in to check.
Keep the format or change it
| Sample | JPG quality 80 | WebP quality 80 | PNG 256 colors |
|---|---|---|---|
| Fruit photo (332 KB) | 246 KB | 142 KB | 589 KB |
| Transparent graphic (71 KB) | 31 KB (transparent → white) | 31 KB | 32 KB |
- Photos: JPG or WebP: saving the same photo as PNG is much larger than JPG even after reducing it to 256 colors.
- Transparent backgrounds, text and line art: PNG: JPG has no transparency, so transparent areas are filled with white, and text edges tend to blur.
- If the recipient requires a format, keep the original: many places accept only JPG. The default, “Original”, saves JPG as JPG and PNG as PNG. Other formats such as AVIF, BMP and HEIC are saved as JPG, or as PNG if they have transparent areas.
- For the web, consider WebP too: at the same quality 80, WebP was smaller than JPG for the sample photo. Some forms and programs do not accept WebP, though.
1 KB is counted as 1,000 bytes
In the International System of Units, kilo (k) means 1,000, and 1,024 is written with the separate binary prefix kibi (Ki). The U.S. National Institute of Standards and Technology (NIST) explains that computing used kilo for 1,024 because 210 is close to 1,000. Even now, depending on the operating system or the site, 1,024 bytes may be shown as 1 KB, so the same file can show different numbers in different places.
This tool counts 1 KB as 1,000 bytes. Because counting by 1,000 is stricter than counting by 1,024, a file fitted to a 200 KB target at 198,940 bytes is 195 KB when counted by 1,024. It stays within a 200 KB limit whichever way the site counts. KB and MB on screen are rounded up, so if the screen says 200 KB, the file really is 200,000 bytes or less.
What to zoom in on before saving
- Edges of text and lines: JPG tends to leave smudges (ringing) around edges. For screenshots and photos of notices, check the text at 100%.
- Smooth areas such as sky, walls and skin: at low quality the 8 × 8 block pattern shows first, and with few PNG colors banding shows first.
- Fine texture such as hair, grass and fabric: check whether the texture is smeared flat.
- The spot that changed the most: pressing the 100% or 200% button under “Fit” centers the spot where the original and the result differ most. “Show diff” paints changed pixels from yellow to red (differences are amplified 6 times).
Common mistakes
- Compressing the same photo several times: JPG loses a little more with every save. Do not shrink a file that was already shrunk; compress the original once.
- Shrinking the pixel size where a pixel range is required: a place that sets a width and height range, like a passport photo, rejects the file if the size changes. Turn on “Keep pixel size (quality only)” to lower only the quality.
- Saving a transparent PNG as JPG: transparent areas are filled with white. For a logo that needs an empty background, save as PNG or WebP.
- Adding HEIC or AVIF without checking the format: even with “Original”, these formats become JPG (or PNG if transparent). Check the format the recipient requires.
- Adding an animated GIF: only the first frame is saved, as PNG. To keep the animation, use a GIF size reducer instead.
Your images and privacy
Images are read and saved only inside this browser and are never sent to a server. PNG color reduction and the WebP saving used on Safari also run in a worker thread within this page. A re-saved file carries no Exif data (location, date taken, camera model and so on), and the photo's rotation is applied before saving. When the original is handed back as is (already under the target, or smaller than the re-saved version), the image data is left untouched and only metadata blocks such as Exif and XMP are removed. A file whose orientation would change without its metadata, such as a JPG with a rotation tag, is re-saved instead.
Limits
- The same quality value gives different file sizes in different browsers. The numbers in the tables were measured on 2026-10-20 in Chrome 151, and they can differ by a few percent in Safari or Firefox.
- JPG is saved with the encoder built into the browser; dedicated encoders such as mozjpeg are not used.
- Starting to shrink the size at quality 50 (or 64 colors for PNG) is this tool's own choice, and it does not judge picture quality with a number.
- A photo taken in a wide color space such as Display P3 is converted to sRGB, so very saturated colors can look slightly paler.
- It opens up to 50 images at a time, 50 MB each, and up to 100 megapixels. On iPhone and iPad the size is reduced further to fit the canvas area limit (16,777,216 pixels), and WebP is limited to 16,383 px on a side.
- It does not save AVIF, and animated GIF, WebP and APNG are saved as the first frame only. The curve is drawn only for the one image you have selected, after all images have been shrunk.
Basis: the matching sentences in the documents below were checked on 2026-10-20.
Sources
- 01libjpeg-turbo — jcparam.c (jpeg_quality_scaling)Quality 50 uses the base table unchanged (scale 100); 50 to 100 maps to 200 − 2 × quality, and 1 to 50 to 5000 ÷ quality in percent
- 02WHATWG HTML Living Standard — canvas toBlob and toDataURLThe quality argument applies only to types with variable quality, such as image/jpeg; for an unsupported type the result is image/png
- 03W3C — Portable Network Graphics (PNG) Specification (Third Edition)PLTE holds 1 to 256 palette entries, tRNS gives an alpha value per palette entry, and filter type 0 (None) is usually the most effective for color type 3
- 04MDN — CompressionStream() constructor"deflate" compresses with the DEFLATE algorithm in the ZLIB data format (Baseline, widely available)
- 05Heckbert, P. (1982). Color image quantization for frame buffer display. SIGGRAPH '82, 297–307An adaptive quantization algorithm that reduces a color image to a fixed number of colors
- 06NIST — Prefixes for binary multipleskilo = 103, kibi (Ki) = 210. Explains the older computing habit of using kilo to mean 1,024
- 07Chrome for Developers — Efficiently encode imagesLists unoptimized images with the savings available; smaller images make the page load faster and use less data
- 08U.S. Department of State — Upload a digital photo (online passport renewal)"The file size should be between 54 KB and 10 MB."
- 09MDN — <canvas>: Maximum canvas sizeThe maximum size differs by browser, and iOS devices allow 4,096 × 4,096 pixels
- 10Google for Developers — WebP FAQThe maximum pixel size of a WebP image is 16383 × 16383
Frequently asked questions
Are my images uploaded to a server?
No. Images are read and re-saved only inside this browser. PNG color reduction and the WebP saving used on Safari also run in a worker thread within the page, and no file is sent to a server.
How does it hit a 200 KB target?
It splits the range between quality 95 and 50 in half again and again, saving for real each time, and picks the highest quality that does not exceed 200 KB. The sample photo (332 KB) came out at 199 KB with quality 76. If even quality 50 is over, it keeps quality 50 and reduces the width and height.
Can I keep the pixel width and height unchanged?
Yes. With “Keep pixel size (quality only)” on, the size stays as it is and only the quality is lowered, down to 1. Use it where both a pixel range and a file size are set, such as a passport photo. If the file is still over the target, it is marked “Over target” in the list.
Does it shrink PNG too?
Yes. PNG has no quality setting, so the tool saves it with a palette of 2 to 256 colors. The transparent background stays, and screenshots or icons that already use 256 colors or fewer shrink without any loss. The sample transparent graphic went from 71 KB to 32 KB with 256 colors.
The file got bigger after compressing.
Re-saving an already compressed JPG at a high quality (90 or more) can make it larger. If the result is bigger than the original while the format and size stay the same, this tool returns the original, and it does not re-save an original that is already under the target. To shrink further, pick a lower quality on the curve.
I fitted it to 200 KB but the site says it is too big.
This tool counts 1 KB as 1,000 bytes, so the file stays under the limit even on sites that count 1,024 bytes. If it is still rejected, check the pixel size and format conditions, such as sites that accept only JPG. Where the size must not change, turn on “Keep pixel size (quality only)”.
Can I shrink several images at once?
Yes. You can add 50 images at a time, 50 MB each, and all of them are shrunk with the same target and settings. The list shows each result size and whether it is within the target, and you can save everything as a single ZIP.
Is the location in my photo removed too?
Yes. A re-saved file carries no Exif data such as the GPS location, the date taken or the camera model. The photo's rotation is applied before saving, so it still looks the right way up. Even when the original is handed back as is, metadata blocks such as Exif and XMP are removed.