How to optimize images for the web
- Add your images. Drop them on the box, click it to choose files, or paste a screenshot. You can add up to 50 at once, in any format your browser can open: JPG, PNG, WebP, AVIF, GIF, BMP and SVG.
- Pick the output format. WebP is the smallest for websites. JPG works everywhere, including email and print. PNG is lossless and keeps transparency. Same keeps each file in its own format, which is what you want when you only need smaller files.
- Set the quality or a target size. Quality 80 is a sensible start. If a form or a platform has a limit, such as 100 KB or 2 MB, switch to Target size and type it in.
- Resize if the image is bigger than it will be shown. A phone photo is often 4,000 pixels wide or more. Few websites show an image wider than 2,000 pixels, so choosing a maximum width usually saves more than any quality setting.
- Compare, then download. Click Compare on any file and drag the divider to see the original and the result side by side. Switch to 100% to check fine detail. Download each file, or all of them as a ZIP.
Image optimizer, image compressor, photo compressor: the names change, the job is the same. In the UK you will also see it spelled optimiser. Each file shows its size before and after and the percentage saved, so you know what you gained before you download anything.
WebP, JPG, PNG or AVIF: which format to use
The format decides more of the final size than the quality setting does. A rough guide:
| Format | Best for | Transparency | Watch out for |
|---|---|---|---|
| WebP | Almost everything on a website: photos, product shots, cutouts, banners | Yes | Some email programs, print shops and older desktop apps still do not accept it |
| JPG | Photos that leave the web: email, documents, printing, marketplaces with strict rules | No, transparent areas become white | Blurry edges around text and flat colors |
| PNG | Screenshots, diagrams and graphics with few colors, when every pixel must stay exact | Yes | Photos as PNG are several times bigger than the same photo as WebP or JPG |
| AVIF | Websites that want the smallest files and can wait a little longer for encoding | Yes | Only some browsers can create it, so the option appears only where yours can |
Google, which created WebP, measured its lossy files at 25 to 34% smaller than JPEGs of the same visual quality, and its lossless files at 26% smaller than PNGs. Results vary with every image, which is why the tool shows the real number for each of yours. For logos and icons, consider SVG instead: a vector file stays sharp at any size and is often smaller than any of these.
Converting to WebP, and back
Drop PNG or JPG files and choose WebP to convert PNG to WebP or JPG to WebP in one go. Going the other way, for a program or a print shop that does not accept WebP, use the WebP to PNG converter, which keeps transparency, or the WebP to JPG converter for photos and smaller files.
How much quality can you drop?
The quality number is a dial for how much detail the encoder may throw away. It is not a percentage of the original, and quality 80 in WebP is not the same as 80 in JPG or AVIF. As a starting point:
- 85 to 90: large hero images and photos where people will look closely, such as products and portfolios.
- 75 to 85: most photos on a website. The difference from the original is hard to see without zooming in.
- 60 to 75: thumbnails and small images, where the eye cannot see the loss.
- Under 60: blocks and smears start to appear in skies, skin and smooth gradients.
Text, logos and screenshots behave differently from photos: sharp edges show compression sooner. Keep them as PNG, or use WebP at 90 or more. Whatever you choose, open Compare at 100% and look at the busiest part of the image and at any flat area, such as sky or a plain wall. If you cannot see a difference there, you will not see one on the page.
What size should images be for a website?
Size images for the space they fill on the page, times two for sharp screens. A blog column 800 pixels wide needs an image about 1,600 pixels wide; a full-width banner rarely needs more than 2,560. Anything larger is downloaded and then shrunk by the browser, which costs your visitors time for nothing.
That time matters most for the largest image near the top of the page. Google measures loading with Largest Contentful Paint (LCP), and counts a page as good when its largest element appears within 2.5 seconds. Three habits keep images from dragging that down:
- Width and height in the HTML. Give every image its width and height attributes, so the browser reserves the space and the text does not jump as the image arrives.
- Lazy loading below the first screen. Add
loading="lazy"to images further down the page, and never to the main image at the top. - Several sizes for several screens. With
srcset, a phone downloads a 800 pixel version and a large monitor a 1,600 pixel one. Run the same images through this tool twice, at two widths, to make both.
Why PNG files barely shrink here
PNG is lossless, so a PNG encoder cannot throw detail away; it can only pack the same pixels more tightly. Browsers pack them quickly rather than as tightly as possible, so a PNG saved here can come out about the same size as your original, or bigger. When that happens and the format and size have not changed, the tool keeps your original file.
Services that cut PNGs by 60 to 80% do something different: they reduce the image to a palette of 256 colors or fewer, which works well for flat graphics and badly for photos. This tool does not reduce colors. If your PNG is a photo or a cutout with a transparent background, convert it to WebP: transparency is kept and the file is usually a small fraction of the size. Try the sample above to see it.
What the optimizer removes from your files
Photos from phones and cameras carry EXIF metadata: the camera model, the date and time, and often the exact GPS location where the photo was taken. Every file this tool creates is drawn fresh from the pixels, so none of that is copied. That makes the files a little smaller and safer to publish. The rotation stored in the metadata is applied to the pixels first, so portrait photos stay upright.
Two more things change. Color profiles are not embedded: the browser converts the image to standard sRGB, the color space of the web, so photos shot in a wider color space can look slightly less vivid. And animated GIFs and WebPs keep only their first frame. If you need the metadata, the profile or the animation, keep your original file.
Methodology and limits
- Decoding
- Each file is opened by your browser as an image on your device, with its rotation metadata applied. Formats work where the browser can open them: HEIC usually only in Safari. SVG files need a width and height. Nothing is uploaded.
- Resizing
- Images wider than the chosen maximum are scaled to that width, keeping the proportions, and never enlarged. Large reductions are done in halving steps with the browser's high quality smoothing, to avoid jagged edges. Images over 50 million pixels (16.7 million on phones and tablets) are scaled down to fit the browser's canvas memory, and the file row says so.
- Encoding
- The resized pixels are drawn on a canvas and saved with the browser's own encoder (canvas toBlob) for WebP, JPEG, PNG and, where the browser supports it, AVIF. Support is tested when the page loads by encoding a small image; a format the browser cannot create is disabled. The quality slider maps 10 to 100 onto the encoder's 0.1 to 1. PNG is always lossless and is not reduced to a palette. For JPG, transparent areas are filled with white.
- Target size
- The tool first tries quality 92, then searches between 50 and 92 in up to six halving steps for the highest quality that fits. If quality 50 is still too big, it reduces the dimensions in proportion to the excess, between 10 and 50% at a time, and searches again. PNG only changes dimensions. The row shows the quality and size it settled on, or the smallest it reached if it could not fit.
- Sizes and savings
- Sizes use 1 KB = 1,000 bytes and 1 MB = 1,000,000 bytes, as macOS shows them. Windows divides by 1,024, so it shows the same file slightly smaller. The saving is 1 minus the new size divided by the original size. Kept originals count at their original size.
- Limits
- Metadata (EXIF, GPS, XMP) and color profiles are not copied; colors are converted to sRGB. Animated images keep their first frame. Up to 50 files per batch; very large batches on a phone may run out of memory, so work in smaller groups there. Output from the same settings can differ slightly between browsers, because each uses its own encoder.
Sources
Show all 8 sources
- An image format for the Web (WebP), Google for Developers, with the 25 to 34% and 26% size comparisons against JPEG and PNG
- WebP Compression Study, Google for Developers, the method behind those comparisons
- HTMLCanvasElement: toBlob() method, MDN Web Docs, the browser encoder this tool uses
- Image file type and format guide, MDN Web Docs, on WebP, AVIF, JPEG and PNG support
- WebP image format, Can I use, browser support for displaying WebP
- Largest Contentful Paint (LCP), web.dev (Google), with the 2.5 second threshold
- Optimize Cumulative Layout Shift, web.dev (Google), on width and height attributes for images
- Lazy loading, MDN Web Docs, on
loading="lazy"for images


